diff --git a/experiments/reposhell-prompt-propensity/README.md b/experiments/reposhell-prompt-propensity/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d9bb8d24a9779c602aec0412f71432607b0ba299 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/README.md @@ -0,0 +1,78 @@ +# Reposhell Prompt Propensity Experiment + +This experiment tested whether prompt-only wording changes can make +`gemma-4-e4b-it` more likely to use Localpager's read-only repository inspection +tool during OpenClaw classification, without naming `bash` or requiring a bash +call. + +## Result + +Across the completed runs: + +| Group | Classifier calls | Prompt variants | Sessions with bash | Bash calls | Failed calls | +|---|---:|---:|---:|---:|---:| +| Weak/implicit evidence wording | 24 | 4 | 0 | 0 | 0 | +| Stronger optional repository-evidence wording | 24 | 4 | 0 | 0 | 1 | +| Focused source-first wording | 18 | 3 | 0 | 0 | 1 | +| **Total** | **66** | **11** | **0** | **0** | **2** | + +The prompt-only changes did **not** increase reposhell use under these +conditions. Even wording that said source evidence should normally be checked +for code-specific items produced `0` bash calls. + +## Completed Runs + +- `run-20260615T143851Z`: baseline, evidence-light, source-grounding, + truncation-aware. +- `run-20260615T144427Z`: baseline, tool-aware-optional, one-lookup-budget, + source-metadata-split. +- `run-20260615T145111Z`: baseline, source-first-code-items, + final-after-evidence. + +Each completed run directory contains: + +- `README.md`: per-run summary table. +- `results.json`: machine-readable per-run records, session paths, commands, + prompt paths, and stderr/stdout log paths. +- `prompts/*.prompt.md`: full rendered prompt templates used by that run. +- `contexts/*.md`: cached GitHub context used for every variant. +- `state/*/sessions/*.jsonl`: saved Pi/localpager-agent session transcripts. + +## Interpretation + +The production prompt strongly asks for final structured JSON and says the task +is classification, not code search. The e4b model appears to satisfy the +structured-output instruction directly instead of voluntarily using the +available repository tool, even when the prompt says source evidence may or +should be checked. + +The historical bash-using sessions were created by prompts that included much +more direct tool-use pressure, for example asking for a concise read-only call. +This experiment suggests that if reposhell use is required for certain classes +of classifier inputs, relying on soft prompt wording is not enough. A runtime +policy or explicit conditional instruction is likely needed. + +## Reproduction + +Run from the scratch repo: + +```sh +node experiments/reposhell-prompt-propensity/run_experiment.mjs +``` + +The runner uses: + +- Localpager checkout: `/home/bob/repos/localpager` +- Config: `/home/bob/.config/localpager/config.json` +- Model: `gemma-4-e4b-it` +- Reposhell socket: `/home/bob/.local/state/localpager/reposhell.sock` +- Targets: + - `openclaw/openclaw#84509` + - `openclaw/openclaw#91046` + - `openclaw/openclaw#81443` + - `openclaw/openclaw#88504` + - `openclaw/openclaw#88875` + - `openclaw/openclaw#52126` + +The runner reuses cached contexts from prior completed run directories when +available, to avoid repeated GitHub context fetches. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/README.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/README.md new file mode 100644 index 0000000000000000000000000000000000000000..65983d890f8d8dd507e289c7892b06528ea63226 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/README.md @@ -0,0 +1,90 @@ +# Reposhell Prompt Propensity Experiment + +Created: 2026-06-15T14:43:37.930Z + +Goal: test whether prompt wording can increase voluntary read-only repository inspection without explicitly naming or requiring the `bash` tool. + +## Setup + +- Model: `gemma-4-e4b-it` +- Target count: 6 +- Variant count: 4 +- Reposhell was exposed through the Localpager agent runtime. +- Localpager repo files were not edited; generated prompts, logs, sessions, and summaries are under this scratch experiment directory. + +## Summary + +| Variant | Runs | Sessions with bash | Successful bash sessions | Bash calls | Successful bash calls | Failures | Mean elapsed ms | +|---|---:|---:|---:|---:|---:|---:|---:| +| baseline | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 17937 | +| evidence-light | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 10620 | +| source-grounding | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 8754 | +| truncation-aware | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 8614 | + +## Variants + +### baseline + +Baseline production prompt. + +### evidence-light + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +### source-grounding + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +### truncation-aware + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Per-Run Results + +| Variant | Target | Status | Bash calls | Successful bash calls | Final JSON calls | Commands | +|---|---|---:|---:|---:|---:|---| +| baseline | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| evidence-light | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| evidence-light | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| evidence-light | openclaw/openclaw#81443 | 0 | 0 | 0 | 1 | | +| evidence-light | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| evidence-light | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| evidence-light | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#84509 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#81443 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| source-grounding | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#84509 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#81443 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| truncation-aware | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | + +Full machine-readable output: `results.json`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/auth.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/auth.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/auth.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/models.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/models.json new file mode 100644 index 0000000000000000000000000000000000000000..9691cad056c66f40137e59d72ed52203186d894d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/models.json @@ -0,0 +1,31 @@ +{ + "providers": { + "local-openai": { + "baseUrl": "http://127.0.0.1:1234/v1", + "api": "openai-completions", + "apiKey": "local", + "compat": { + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "models": [ + { + "id": "gemma-4-e4b-it", + "name": "Local model (gemma-4-e4b-it)", + "reasoning": false, + "input": [ + "text" + ], + "contextWindow": 131072, + "maxTokens": 768, + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + } + } + ] + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/settings.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..87b89cc5721ad377c5b2c8ee1fd4e8bceb73d3ae --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/pi-config-runtime/settings.json @@ -0,0 +1,12 @@ +{ + "defaultProvider": "local-openai", + "defaultModel": "gemma-4-e4b-it", + "defaultThinkingLevel": "off", + "enableInstallTelemetry": false, + "quietStartup": true, + "compaction": { + "enabled": true, + "reserveTokens": 16384, + "keepRecentTokens": 20000 + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-3NhAn3/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-3NhAn3/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-3NhAn3/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-5UZUUG/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-5UZUUG/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-5UZUUG/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-7IIyRn/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-7IIyRn/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-7IIyRn/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-8GI8Q6/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-8GI8Q6/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-8GI8Q6/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-9dSCU5/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-9dSCU5/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-9dSCU5/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-DrR6yS/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-DrR6yS/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-DrR6yS/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-ETnRKy/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-ETnRKy/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-ETnRKy/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-JzXZQ5/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-JzXZQ5/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-JzXZQ5/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-NztNvQ/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-NztNvQ/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-NztNvQ/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-QVZr1G/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-QVZr1G/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-QVZr1G/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-STpIHB/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-STpIHB/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-STpIHB/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-T5x1tz/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-T5x1tz/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-T5x1tz/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-UZPmus/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-UZPmus/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-UZPmus/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-YOgqTL/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-YOgqTL/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-YOgqTL/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-jCasgH/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-jCasgH/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-jCasgH/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-lpPj6d/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-lpPj6d/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-lpPj6d/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pKw5pP/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pKw5pP/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pKw5pP/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pWsmhS/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pWsmhS/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-pWsmhS/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-tGkRpy/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-tGkRpy/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-tGkRpy/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-u0s9He/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-u0s9He/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-u0s9He/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-vVMQR0/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-vVMQR0/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-vVMQR0/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaOuSX/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaOuSX/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaOuSX/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaiRby/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaiRby/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xaiRby/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xjNjX3/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xjNjX3/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/reposhell/run-xjNjX3/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-0ieK5t/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-0ieK5t/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-0ieK5t/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-4NoNiu/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-4NoNiu/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-4NoNiu/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-5gbl59/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-5gbl59/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-5gbl59/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-7RH1PU/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-7RH1PU/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-7RH1PU/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-87fl4J/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-87fl4J/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-87fl4J/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-9PHRXq/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-9PHRXq/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-9PHRXq/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-A46wM4/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-A46wM4/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-A46wM4/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-JACl83/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-JACl83/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-JACl83/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-LyeWg0/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-LyeWg0/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-LyeWg0/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-OWip5x/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-OWip5x/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-OWip5x/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Q8aNBF/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Q8aNBF/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Q8aNBF/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-SuGPiw/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-SuGPiw/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-SuGPiw/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-XdCkY5/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-XdCkY5/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-XdCkY5/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZJJo1G/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZJJo1G/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZJJo1G/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZUWCrs/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZUWCrs/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ZUWCrs/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Zehefa/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Zehefa/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-Zehefa/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-a1vDEa/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-a1vDEa/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-a1vDEa/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-d8wH8Z/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-d8wH8Z/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-d8wH8Z/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-dqhus9/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-dqhus9/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-dqhus9/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ghtFUD/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ghtFUD/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ghtFUD/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-gwFUzL/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-gwFUzL/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-gwFUzL/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-pqOgX0/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-pqOgX0/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-pqOgX0/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-uUhOM2/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-uUhOM2/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-uUhOM2/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ydDCl9/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ydDCl9/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/request-params/run-ydDCl9/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..c53327a12823e1e3edcb39fdcf34f334de0bd42f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..b30b09f185680266059176a8a9468c2195e72227 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent behavior. The full scope of the system is not visible." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level, specifically targeting dangerous command execution patterns within the agent runtime." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..89fd64ed408ed02a58329c816da9c7ae8ae443cb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..731e203180541461ed0cd869731114b8d04b29bb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..612627cff608821ebbda649a18d67ed8f5ae3878 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f55283fb1263f4d5b4dda3432d97f474a553fc85 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c6c49fc73ed8393e62cb8c6125d24b50a2f461b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..6ee7aeb13fb0ed54857533aa715537825ff18280 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the agent runner logic and provider configuration changes, which are central to routing/runtime behavior." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..7fc01bc48c41605fce78de1f3fb09c23aa1534e7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..89fc84596a40240eb1a6716e50212dd695c6619a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..76943d28363978a9383f25fc35498070c39a3940 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts with inline invariant notes." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..53afb5d161d3f6b4e6001b26345708ddc45c48eb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..a3ecff82ad2931319f94abd24c92745b568a996f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, addressing a gap in the generic repeat detector for dangerous execution commands." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..38e037362ec4f56450a2eecb467139a707194ba2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..c6bf8159e165122ca31585f0654014c0afabef50 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context shows ACP protocol changes related to text preservation during tool use in final_only mode." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ea900b973814c89c69378678942b1fa09647098 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..e53ebbe093e76bdf326897521024e30e3a00dcd6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..09c73f3f6b5ace3b48c733f51e6705d03241b77e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and provider timeout handling, but the core routing issue seems related to how external URLs are handled during media generation." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This pull request fixes issues with Windows QMD shims and guards image URL downloads when parsing OpenAI-compatible responses through the gateway." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..254c2014240ac3a62cb33f103e2402949a0f948d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..f67a36cdb5838eb09cf910bd82508f25d3b6b225 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..3e899e854c034c01d864956b3d796dbc6d11829b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the core issue described relates to text preservation during tool use in 'final_only' delivery mode." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset the turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..f02902cb9c473f29b342451e7da29f07f2ba57b1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..cafda27f080129624f4765ef5390d43ad0633d72 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..6e79a978fb57ae66ed8ae8f25c9ed787ed66a29e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The context mentions changes across many subsystems (markdown, gateway, channel, etc.), but the primary action is documentation cleanup." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..02e7bd985825350c4f6153c7e021d8ce93a6fd1a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..98fef5b92585553b132d751d77a5f5955f1c0a2f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c8e878b777f1cbe162699c36a10f40b7e24410b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..e634c336aeb920cc33067bd49a8b25754ab27040 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f3046b8d697ce643ce946cecacbbf5ccdbdeeefa --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The context is truncated, but the core logic change in `extra-params.ts` and its corresponding test case are present." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0a4a8b6699b49b4ad6ba4b79afdf3b86c04cada --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..0caeb776a7870f8eb5a0a5be19b8d42a3e802a3a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the title and surrounding context provide sufficient evidence for classification." + ], + "topics_of_interest": [ + "gateway", + "memory" + ], + "description": "This PR fixes Windows QMD shim paths and guards image URL downloads within provider implementations, affecting gateway and memory components." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..8cb1b62b4a19a2bb9be799282d2bf835507a8676 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..a1eaf62faaebad39714d529e71ac63057387c3fc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the title and surrounding context clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b69f12fab2b0dfb3145476063e18b339359a184 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..123e3d0d0a27dfb20d86feb5260f3a682ec3af7a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is a PR description and diff focusing on ACP protocol behavior for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the technical details of this fix." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset turn state during tool use." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..5db74d51785f15a59c43ab996d05eaef82fc9c5f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..c23f5c0e59b8f1c2d362b7f2874e02d357efa2e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the provided PR description and diff, which focuses on runtime parameter handling within agent execution logic." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..346c18e173fe21c2d502dbeb6ef265e2f324d735 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..4d953503f9ad6862711943b8913675294f42c061 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a large PR diff and body summary; the classification relies on the high-level description of fixes related to image generation providers and Windows shims." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This PR resolves issues with Windows QMD shims and guards provider-returned image URL downloads through a guarded HTTP path within the gateway context." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21d388a67d585f68e413353303cc4d6b5e47747d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1f553c4df73f17c96d249a4981757cb3f94eec13 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, specifically addressing the high risk associated with shell execution." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..1915eda3e7441150f76c1bc06f36115ed810b11c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-52126.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-52126.md new file mode 100644 index 0000000000000000000000000000000000000000..be82df8a4351d2b4acfe88676c058f3073716dc6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-52126.md @@ -0,0 +1,168 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-81443.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-81443.md new file mode 100644 index 0000000000000000000000000000000000000000..7b178accfcec455ab65201d98961ef0470f78992 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-81443.md @@ -0,0 +1,219 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-84509.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-84509.md new file mode 100644 index 0000000000000000000000000000000000000000..0223bcacf512af850ab96d12f6c8f91e7137bfdb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-84509.md @@ -0,0 +1,209 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88504.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88504.md new file mode 100644 index 0000000000000000000000000000000000000000..4ac10500b86ec809387c59d86e7e407f694f37e4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88504.md @@ -0,0 +1,170 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88875.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88875.md new file mode 100644 index 0000000000000000000000000000000000000000..83adcfc7633c6424cf576a6788f9bae1438680be --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88875.md @@ -0,0 +1,70 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-91046.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-91046.md new file mode 100644 index 0000000000000000000000000000000000000000..b03d107469f70f1647247a41a4adc60c58d42c99 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-91046.md @@ -0,0 +1,121 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..336c82d12bcfb397ffa81ae1cf26eba43f63b4c1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144044Z-1663147.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144044Z-1663147.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..cc574671ece8ca9d4334ae98b0073c7f3b80fd68 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T143933Z-1660041.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T143933Z-1660041.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..5ee33868794e125ebb73402bdeef76b23760b6c2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T143902Z-1659606.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T143902Z-1659606.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..b4d82ab3fee37e89eadcfc2bd8d6741ac484b0c9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144025Z-1662838.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144025Z-1662838.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..1acbbde72b16795a9635550337286d53bdf73174 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144033Z-1662977.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144033Z-1662977.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..a34491b6083f33d06945cbd9bdb14eba939505fb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T143921Z-1659853.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T143921Z-1659853.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..c349c4976e77b288af65196c72a08dba9e40f966 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/prompts/20260615T144147Z-1664974.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/schemas/20260615T144147Z-1664974.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1f553c4df73f17c96d249a4981757cb3f94eec13 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, specifically addressing the high risk associated with shell execution." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..6231891402baf42583257474bbf4055acb0cc1c6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/prompts/20260615T144122Z-1664534.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/schemas/20260615T144122Z-1664534.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..4d953503f9ad6862711943b8913675294f42c061 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a large PR diff and body summary; the classification relies on the high-level description of fixes related to image generation providers and Windows shims." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This PR resolves issues with Windows QMD shims and guards provider-returned image URL downloads through a guarded HTTP path within the gateway context." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..68bcdd812a913149a5f73079f528ffc2a76b3f2c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/prompts/20260615T144050Z-1663260.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/schemas/20260615T144050Z-1663260.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..c6bf8159e165122ca31585f0654014c0afabef50 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context shows ACP protocol changes related to text preservation during tool use in final_only mode." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4751def7db63a33430c82d51bcb575b31a9dd345 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/prompts/20260615T144129Z-1664655.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/schemas/20260615T144129Z-1664655.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f55283fb1263f4d5b4dda3432d97f474a553fc85 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..8d495305a4f755d2f30382188b09486c97b4bc5c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/prompts/20260615T144136Z-1664799.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/schemas/20260615T144136Z-1664799.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..731e203180541461ed0cd869731114b8d04b29bb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..5371279ebbb381c1e8ba1d6cb99de1bd786e5edd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/prompts/20260615T144109Z-1664310.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/schemas/20260615T144109Z-1664310.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..6ee7aeb13fb0ed54857533aa715537825ff18280 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the agent runner logic and provider configuration changes, which are central to routing/runtime behavior." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-52126.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-52126.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..88d999d532e8539e88892c0c30f12b6eb7ce3598 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-52126.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-52126.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-52126.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-52126.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-81443.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-81443.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..0a04808d976ae865b7f4d30105df69f06f1ccc8a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-81443.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-81443.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-81443.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-81443.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-84509.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-84509.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..1286f753e38253045456482ed31bf2873e58557e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-84509.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-84509.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-84509.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-84509.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88504.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88504.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4aa019560440081d53fec893b1e27573b77687b3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88504.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88504.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88504.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88504.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88875.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88875.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..2be926a8cf4a0a4f85b711bfc62a5f5b41902d80 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88875.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-88875.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88875.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-88875.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-91046.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-91046.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..6e4917e9656d0d474b63eda14a39a602404a654d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-91046.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/contexts/openclaw-openclaw-91046.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-91046.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/openclaw-openclaw-91046.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..7e39ed2bdc0da2dad3ff325cf43d588fd315d258 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/prompts/20260615T144239Z-1665838.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/schemas/20260615T144239Z-1665838.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..b30b09f185680266059176a8a9468c2195e72227 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent behavior. The full scope of the system is not visible." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level, specifically targeting dangerous command execution patterns within the agent runtime." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..17cd6cd1814f0d24503070ee32246012ad79f8c8 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/prompts/20260615T144213Z-1665396.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/schemas/20260615T144213Z-1665396.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..09c73f3f6b5ace3b48c733f51e6705d03241b77e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and provider timeout handling, but the core routing issue seems related to how external URLs are handled during media generation." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This pull request fixes issues with Windows QMD shims and guards image URL downloads when parsing OpenAI-compatible responses through the gateway." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..68908e9232642742d6f9a841ce6bfe5dfa650817 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/prompts/20260615T144153Z-1665096.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/schemas/20260615T144153Z-1665096.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..123e3d0d0a27dfb20d86feb5260f3a682ec3af7a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is a PR description and diff focusing on ACP protocol behavior for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the technical details of this fix." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset turn state during tool use." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..b37cf1c4abbc72586675c430830489dcf292e6d7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/prompts/20260615T144221Z-1665555.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/schemas/20260615T144221Z-1665555.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..98fef5b92585553b132d751d77a5f5955f1c0a2f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..82d5b7877badd1e6c06250c61f5e8440707b5e52 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/prompts/20260615T144229Z-1665678.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/schemas/20260615T144229Z-1665678.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..76943d28363978a9383f25fc35498070c39a3940 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts with inline invariant notes." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..3cbd851e06c45589c7a6a55ee77ccccd512d9e00 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/prompts/20260615T144201Z-1665226.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/schemas/20260615T144201Z-1665226.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..c23f5c0e59b8f1c2d362b7f2874e02d357efa2e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the provided PR description and diff, which focuses on runtime parameter handling within agent execution logic." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..f4bde5235edb61d2ca973b303e52f0e3c501508a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/prompts/20260615T144331Z-1666678.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/schemas/20260615T144331Z-1666678.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..a3ecff82ad2931319f94abd24c92745b568a996f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior." + ], + "topics_of_interest": [ + "exec_tools", + "agent_runtime" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, addressing a gap in the generic repeat detector for dangerous execution commands." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4ac1f1a1be88de0a26a874b49c32c1ee47979d0d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/prompts/20260615T144306Z-1666263.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/schemas/20260615T144306Z-1666263.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..0caeb776a7870f8eb5a0a5be19b8d42a3e802a3a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the title and surrounding context provide sufficient evidence for classification." + ], + "topics_of_interest": [ + "gateway", + "memory" + ], + "description": "This PR fixes Windows QMD shim paths and guards image URL downloads within provider implementations, affecting gateway and memory components." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4ce2786a29baf0be56a0671b43f6584e7f90589b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/prompts/20260615T144246Z-1665951.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/schemas/20260615T144246Z-1665951.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..3e899e854c034c01d864956b3d796dbc6d11829b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the core issue described relates to text preservation during tool use in 'final_only' delivery mode." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset the turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..2f193c1f55add5f16f48cb5b5cb1ccb704f666e9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/prompts/20260615T144312Z-1666377.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/schemas/20260615T144312Z-1666377.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..a1eaf62faaebad39714d529e71ac63057387c3fc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body content was heavily truncated, but the title and surrounding context clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..bd568875832ac5759089cf7b2c9933803bbd4783 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/prompts/20260615T144320Z-1666513.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/schemas/20260615T144320Z-1666513.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..6e79a978fb57ae66ed8ae8f25c9ed787ed66a29e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The context mentions changes across many subsystems (markdown, gateway, channel, etc.), but the primary action is documentation cleanup." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..bcf8931e21447d1eb9beeb738cc030a560b5968c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/prompts/20260615T144253Z-1666071.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/schemas/20260615T144253Z-1666071.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f3046b8d697ce643ce946cecacbbf5ccdbdeeefa --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The context is truncated, but the core logic change in `extra-params.ts` and its corresponding test case are present." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/baseline.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/baseline.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..b5a47399be1f9bb46bb0ec18800b51bbafdf1132 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/baseline.prompt.md @@ -0,0 +1,138 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/evidence-light.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/evidence-light.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..e45b79513877aaed2d4628bfed1d93a24b6c74ae --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/evidence-light.prompt.md @@ -0,0 +1,147 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/source-grounding.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/source-grounding.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..a0dff9398d761fa65c2bfebf83a7fca05a34a770 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/source-grounding.prompt.md @@ -0,0 +1,146 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/truncation-aware.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/truncation-aware.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..1220aa328b2f2aafba50fe9870bde9bf0893b9c1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/truncation-aware.prompt.md @@ -0,0 +1,146 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/results.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/results.json new file mode 100644 index 0000000000000000000000000000000000000000..ffca72f779f52dc2a7833ae8798a976bfdb09900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/results.json @@ -0,0 +1,645 @@ +{ + "created_at": "2026-06-15T14:43:37.930Z", + "out_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z", + "localpager_root": "/home/bob/repos/localpager", + "model": "gemma-4-e4b-it", + "targets": [ + "openclaw/openclaw#84509", + "openclaw/openclaw#91046", + "openclaw/openclaw#81443", + "openclaw/openclaw#88504", + "openclaw/openclaw#88875", + "openclaw/openclaw#52126" + ], + "variants": [ + { + "name": "baseline", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/baseline.prompt.md", + "inserted_text": "" + }, + { + "name": "evidence-light", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/evidence-light.prompt.md", + "inserted_text": "## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n" + }, + { + "name": "source-grounding", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/source-grounding.prompt.md", + "inserted_text": "## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n" + }, + { + "name": "truncation-aware", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/prompts/truncation-aware.prompt.md", + "inserted_text": "## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n" + } + ], + "by_variant": [ + { + "variant": "baseline", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 17936.833333333332 + }, + { + "variant": "evidence-light", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 8, + "mean_elapsed_ms": 10620.333333333334 + }, + { + "variant": "source-grounding", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 6, + "mean_elapsed_ms": 8754 + }, + { + "variant": "truncation-aware", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 6, + "mean_elapsed_ms": 8613.833333333334 + } + ], + "results": [ + { + "id": "baseline__openclaw-openclaw-84509", + "variant": "baseline", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 18809, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T143902Z-1659606.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T143902Z-1659606.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-03-762Z_019ecbb8-c252-72c4-86de-92e4d7b487d4.jsonl", + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-16-912Z_019ecbb8-f5b0-7e62-be04-b7de62accb60.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-91046", + "variant": "baseline", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12449, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T143921Z-1659853.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T143921Z-1659853.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853/2026-06-15T14-39-22-152Z_019ecbb9-0a28-7219-86f0-142c3f3a66f3.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-81443", + "variant": "baseline", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 52247, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T143933Z-1660041.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T143933Z-1660041.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041/2026-06-15T14-39-34-572Z_019ecbb9-3aac-70e9-a26e-0339d6eeec10.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88504", + "variant": "baseline", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7308, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144025Z-1662838.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144025Z-1662838.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838/2026-06-15T14-40-26-897Z_019ecbba-0711-705a-b504-423a39cc2fe3.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88875", + "variant": "baseline", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10887, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144033Z-1662977.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144033Z-1662977.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977/2026-06-15T14-40-34-314Z_019ecbba-240a-732f-bbe4-71b6db765243.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-52126", + "variant": "baseline", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5921, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144044Z-1663147.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144044Z-1663147.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/baseline__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147/2026-06-15T14-40-45-103Z_019ecbba-4e2f-740f-9e07-365f483cb30b.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-84509", + "variant": "evidence-light", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 19892, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/prompts/20260615T144050Z-1663260.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/schemas/20260615T144050Z-1663260.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260/2026-06-15T14-40-50-956Z_019ecbba-650c-7b60-a99d-b680671c23cb.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-91046", + "variant": "evidence-light", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12208, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/prompts/20260615T144109Z-1664310.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/schemas/20260615T144109Z-1664310.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310/2026-06-15T14-41-10-866Z_019ecbba-b2d2-73df-b36c-a59bbb87b44c.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-81443", + "variant": "evidence-light", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 7595, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/prompts/20260615T144122Z-1664534.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/schemas/20260615T144122Z-1664534.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534/2026-06-15T14-41-23-121Z_019ecbba-e2b1-78e2-8a44-8a6ba5cae60a.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-88504", + "variant": "evidence-light", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7209, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/prompts/20260615T144129Z-1664655.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/schemas/20260615T144129Z-1664655.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655/2026-06-15T14-41-30-668Z_019ecbbb-002c-73a6-a79b-f36cb61128b0.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-88875", + "variant": "evidence-light", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10835, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/prompts/20260615T144136Z-1664799.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/schemas/20260615T144136Z-1664799.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799/2026-06-15T14-41-37-860Z_019ecbbb-1c44-7751-bae5-41e549d356b0.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "evidence-light__openclaw-openclaw-52126", + "variant": "evidence-light", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5983, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/prompts/20260615T144147Z-1664974.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/schemas/20260615T144147Z-1664974.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/evidence-light__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974/2026-06-15T14-41-48-731Z_019ecbbb-46bb-7c4a-9917-222f999ab697.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-84509", + "variant": "source-grounding", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 7930, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/prompts/20260615T144153Z-1665096.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/schemas/20260615T144153Z-1665096.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096/2026-06-15T14-41-54-749Z_019ecbbb-5e3d-7c20-aa4e-f33d8a895769.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-91046", + "variant": "source-grounding", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12326, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/prompts/20260615T144201Z-1665226.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/schemas/20260615T144201Z-1665226.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226/2026-06-15T14-42-02-632Z_019ecbbb-7d08-709d-be4a-5c7bd02e9ac7.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-81443", + "variant": "source-grounding", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 7778, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/prompts/20260615T144213Z-1665396.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/schemas/20260615T144213Z-1665396.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396/2026-06-15T14-42-14-960Z_019ecbbb-ad30-7be2-b980-1d09a71a0bb2.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-88504", + "variant": "source-grounding", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7300, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/prompts/20260615T144221Z-1665555.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/schemas/20260615T144221Z-1665555.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555/2026-06-15T14-42-22-735Z_019ecbbb-cb8f-719d-a1dc-c84a106debd3.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-88875", + "variant": "source-grounding", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10463, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/prompts/20260615T144229Z-1665678.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/schemas/20260615T144229Z-1665678.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678/2026-06-15T14-42-30-096Z_019ecbbb-e850-7f5d-bd35-20f2dd519351.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-grounding__openclaw-openclaw-52126", + "variant": "source-grounding", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 6727, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/prompts/20260615T144239Z-1665838.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/schemas/20260615T144239Z-1665838.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/source-grounding__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838/2026-06-15T14-42-40-737Z_019ecbbc-11e1-7505-b5a6-4f8af6d87fce.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-84509", + "variant": "truncation-aware", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 7161, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/prompts/20260615T144246Z-1665951.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/schemas/20260615T144246Z-1665951.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951/2026-06-15T14-42-47-221Z_019ecbbc-2b35-780e-a987-8a55eae9f3db.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-91046", + "variant": "truncation-aware", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12807, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/prompts/20260615T144253Z-1666071.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/schemas/20260615T144253Z-1666071.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071/2026-06-15T14-42-54-448Z_019ecbbc-4770-7426-bb5b-910eac3ab305.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-81443", + "variant": "truncation-aware", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 6610, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/prompts/20260615T144306Z-1666263.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/schemas/20260615T144306Z-1666263.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263/2026-06-15T14-43-07-224Z_019ecbbc-7958-72a1-80ae-0a871164b17b.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-88504", + "variant": "truncation-aware", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7200, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/prompts/20260615T144312Z-1666377.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/schemas/20260615T144312Z-1666377.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377/2026-06-15T14-43-13-831Z_019ecbbc-9327-795a-8fd1-df920df156c9.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-88875", + "variant": "truncation-aware", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 11017, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/prompts/20260615T144320Z-1666513.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/schemas/20260615T144320Z-1666513.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513/2026-06-15T14-43-21-063Z_019ecbbc-af67-7883-acdd-dc5c0ff84425.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "truncation-aware__openclaw-openclaw-52126", + "variant": "truncation-aware", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 6888, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/prompts/20260615T144331Z-1666678.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/schemas/20260615T144331Z-1666678.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/logs/truncation-aware__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678/2026-06-15T14-43-32-008Z_019ecbbc-da27-7090-95c5-fa4704e70b6f.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + } + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144044Z-1663147.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144044Z-1663147.md new file mode 100644 index 0000000000000000000000000000000000000000..9913d2f4cdd5a722dca91f7cc4c8d3407b321905 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144044Z-1663147.md @@ -0,0 +1,385 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144044Z-1663147.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144044Z-1663147.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144044Z-1663147.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147/2026-06-15T14-40-45-103Z_019ecbba-4e2f-740f-9e07-365f483cb30b.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147/2026-06-15T14-40-45-103Z_019ecbba-4e2f-740f-9e07-365f483cb30b.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..2fcdfb52315d187074cc5ed71ace00f1481abeda --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144044Z-1663147/2026-06-15T14-40-45-103Z_019ecbba-4e2f-740f-9e07-365f483cb30b.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbba-4e2f-740f-9e07-365f483cb30b","timestamp":"2026-06-15T14:40:45.103Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"100bfcc6","parentId":null,"timestamp":"2026-06-15T14:40:45.167Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ea852847","parentId":"100bfcc6","timestamp":"2026-06-15T14:40:45.167Z","thinkingLevel":"off"} +{"type":"message","id":"63bc80ed","parentId":"ea852847","timestamp":"2026-06-15T14:40:45.171Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534445171}} +{"type":"message","id":"0c4f59a6","parentId":"63bc80ed","timestamp":"2026-06-15T14:40:49.854Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"818994136","name":"final_json","arguments":{"caveats":["The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5518,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5607,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534445187,"responseId":"chatcmpl-yc9t5lntz75vvrsnptmlr"}} +{"type":"message","id":"2ad8fe95","parentId":"0c4f59a6","timestamp":"2026-06-15T14:40:49.856Z","message":{"role":"toolResult","toolCallId":"818994136","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-NfGl0m/final-output.json"},"isError":false,"timestamp":1781534449855}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T143933Z-1660041.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T143933Z-1660041.md new file mode 100644 index 0000000000000000000000000000000000000000..b3c6370238748f539d5e7fc6c020a583aa726e64 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T143933Z-1660041.md @@ -0,0 +1,436 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T143933Z-1660041.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T143933Z-1660041.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T143933Z-1660041.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041/2026-06-15T14-39-34-572Z_019ecbb9-3aac-70e9-a26e-0339d6eeec10.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041/2026-06-15T14-39-34-572Z_019ecbb9-3aac-70e9-a26e-0339d6eeec10.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..bca20d97f01dc6313f90c24112573a3e9eff15f0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T143933Z-1660041/2026-06-15T14-39-34-572Z_019ecbb9-3aac-70e9-a26e-0339d6eeec10.jsonl @@ -0,0 +1,13 @@ +{"type":"session","version":3,"id":"019ecbb9-3aac-70e9-a26e-0339d6eeec10","timestamp":"2026-06-15T14:39:34.572Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"87b0391c","parentId":null,"timestamp":"2026-06-15T14:39:34.639Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"f58f00f8","parentId":"87b0391c","timestamp":"2026-06-15T14:39:34.639Z","thinkingLevel":"off"} +{"type":"message","id":"ca49ad7d","parentId":"f58f00f8","timestamp":"2026-06-15T14:39:34.642Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534374642}} +{"type":"message","id":"8bd0a967","parentId":"ca49ad7d","timestamp":"2026-06-15T14:39:34.662Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"error","timestamp":1781534374654,"errorMessage":"Connection error."}} +{"type":"message","id":"17074182","parentId":"8bd0a967","timestamp":"2026-06-15T14:39:36.668Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"error","timestamp":1781534376666,"errorMessage":"Connection error."}} +{"type":"message","id":"04a1fcce","parentId":"17074182","timestamp":"2026-06-15T14:39:40.672Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"error","timestamp":1781534380670,"errorMessage":"Connection error."}} +{"type":"message","id":"e74d86aa","parentId":"04a1fcce","timestamp":"2026-06-15T14:39:55.454Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"222219959","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"topics_of_interest":["model_serving","gateway"],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7230,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":7336,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534388678,"responseId":"chatcmpl-hshb6gjinvsmvdq4qpqba"}} +{"type":"message","id":"5970f9ca","parentId":"e74d86aa","timestamp":"2026-06-15T14:39:55.457Z","message":{"role":"toolResult","toolCallId":"222219959","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\"\n}"}],"details":{},"isError":true,"timestamp":1781534395457}} +{"type":"message","id":"2b9ab813","parentId":"5970f9ca","timestamp":"2026-06-15T14:40:00.213Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"813422038","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7496,"output":102,"cacheRead":0,"cacheWrite":0,"totalTokens":7598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534395457,"responseId":"chatcmpl-oxuwaksm20r4jbtokbzuxt"}} +{"type":"message","id":"cab54332","parentId":"2b9ab813","timestamp":"2026-06-15T14:40:00.214Z","message":{"role":"toolResult","toolCallId":"813422038","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\",\n \"topics_of_interest\": [\n \"model_serving\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534400214}} +{"type":"message","id":"327cacd5","parentId":"cab54332","timestamp":"2026-06-15T14:40:25.828Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe user wants me to classify a GitHub PR based on its title and body, routing it for maintainer notification.\nThe required output is a specific JSON structure.\n\nTitle: `fix: resolve QMD Windows shims and guard image URL downloads`\nLabels include: `docs`, `gateway`, `extensions: memory-core`, `agents`, etc.\nBody mentions:\n1. \"Resolve Windows `.cmd` shims...\" (OS/shim issue)\n2. \"Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\" (API parsing, related to model output handling)\n3. \"Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\" (This is key: routing/downloading from a provider URL).\n\nTopics analysis:\n- `model_serving`: Cues include \"streaming behavior, **routing**, lifecycle, and gateway behavi... cues: vllm\". The body explicitly mentions \"Route provider-returned image URLs through guarded HTTP...\" which strongly aligns with serving/routing behavior.\n- `gateway`: Mentioned in labels, and the PR touches on aspects related to how requests flow (though the core fix is about URL handling *after* a response).\n- `local_model_providers`: Not central; it's about handling URLs from providers, not setting up provider configuration/auth.\n\nThe most central theme for routing seems to be the secure handling and routing of external image URLs returned by an OpenAI-compatible provider, which falls under `model_serving`. The mention of \"gateway\" in labels is secondary to the functional fix described in the body regarding URL transport.\n\nI will select `model_serving` as the primary topic. I will keep the description concise and evidence-backed.\n\nRevisiting the previous attempt:\nThe first attempt used `[\"model_serving\", \"gateway\"]`. The second attempt used only `[\"model_serving\"]`. Given the strong focus on URL routing/downloading from a provider response, `model_serving` is sufficient and adheres to the rule of choosing the smallest set.\n\nI will use the refined single-topic classification."},{"type":"toolCall","id":"904264548","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7756,"output":567,"cacheRead":0,"cacheWrite":0,"totalTokens":8323,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534400214,"responseId":"chatcmpl-kbsxe5wd6lcmgnre93809c"}} +{"type":"message","id":"c95e23fe","parentId":"327cacd5","timestamp":"2026-06-15T14:40:25.830Z","message":{"role":"toolResult","toolCallId":"904264548","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-D7nUzT/final-output.json"},"isError":false,"timestamp":1781534425829}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T143902Z-1659606.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T143902Z-1659606.md new file mode 100644 index 0000000000000000000000000000000000000000..181e17dac120c53b9cf4839a86ea6ea616b3ba29 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T143902Z-1659606.md @@ -0,0 +1,426 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T143902Z-1659606.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T143902Z-1659606.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T143902Z-1659606.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-03-762Z_019ecbb8-c252-72c4-86de-92e4d7b487d4.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-03-762Z_019ecbb8-c252-72c4-86de-92e4d7b487d4.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..86f53bcc760cf7d6f580a3ab14d9810b3e5a9877 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-03-762Z_019ecbb8-c252-72c4-86de-92e4d7b487d4.jsonl @@ -0,0 +1,9 @@ +{"type":"session","version":3,"id":"019ecbb8-c252-72c4-86de-92e4d7b487d4","timestamp":"2026-06-15T14:39:03.762Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"4d24f93f","parentId":null,"timestamp":"2026-06-15T14:39:03.827Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"d12d2665","parentId":"4d24f93f","timestamp":"2026-06-15T14:39:03.827Z","thinkingLevel":"off"} +{"type":"message","id":"dc4a80fb","parentId":"d12d2665","timestamp":"2026-06-15T14:39:03.834Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534343833}} +{"type":"message","id":"e8548043","parentId":"dc4a80fb","timestamp":"2026-06-15T14:39:11.060Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"925362124","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6038,"output":118,"cacheRead":0,"cacheWrite":0,"totalTokens":6156,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534343850,"responseId":"chatcmpl-h1cjekrr98s0ztcnjeaghxj"}} +{"type":"message","id":"998e7947","parentId":"e8548043","timestamp":"2026-06-15T14:39:11.064Z","message":{"role":"toolResult","toolCallId":"925362124","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781534351064}} +{"type":"message","id":"4e8f78be","parentId":"998e7947","timestamp":"2026-06-15T14:39:15.976Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"525998615","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"description":"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6328,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":6434,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534351065,"responseId":"chatcmpl-wfjxgdxk3tfht7wktt6mzc"}} +{"type":"message","id":"1358f97b","parentId":"4e8f78be","timestamp":"2026-06-15T14:39:15.978Z","message":{"role":"toolResult","toolCallId":"525998615","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"description\": \"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534355978}} +{"type":"message","id":"aed94e36","parentId":"1358f97b","timestamp":"2026-06-15T14:39:16.228Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6597,"output":1,"cacheRead":0,"cacheWrite":0,"totalTokens":6598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534355978,"responseId":"chatcmpl-8tgf2up90froo3ncf20pv"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-16-912Z_019ecbb8-f5b0-7e62-be04-b7de62accb60.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-16-912Z_019ecbb8-f5b0-7e62-be04-b7de62accb60.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..da5b3603e58eda86afb171c6d413213e18d3a3d0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T143902Z-1659606/2026-06-15T14-39-16-912Z_019ecbb8-f5b0-7e62-be04-b7de62accb60.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbb8-f5b0-7e62-be04-b7de62accb60","timestamp":"2026-06-15T14:39:16.912Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"68fce1bc","parentId":null,"timestamp":"2026-06-15T14:39:16.929Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"31381df3","parentId":"68fce1bc","timestamp":"2026-06-15T14:39:16.930Z","thinkingLevel":"off"} +{"type":"message","id":"57df57c5","parentId":"31381df3","timestamp":"2026-06-15T14:39:16.935Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`.\n\nRetry instruction: your previous response did not call the final_json tool.\n\nDo not call bash. Do not explain anything in prose, markdown, or JSON text.\n\nCall final_json exactly once with a JSON object that matches the schema."}],"timestamp":1781534356934}} +{"type":"message","id":"d577b3d2","parentId":"57df57c5","timestamp":"2026-06-15T14:39:21.066Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"885834415","name":"final_json","arguments":{"caveats":["The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6089,"output":88,"cacheRead":0,"cacheWrite":0,"totalTokens":6177,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534356946,"responseId":"chatcmpl-iaczcyffloznw3v4czxxj"}} +{"type":"message","id":"af2fc1f3","parentId":"d577b3d2","timestamp":"2026-06-15T14:39:21.067Z","message":{"role":"toolResult","toolCallId":"885834415","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gUjyC1/final-output.json"},"isError":false,"timestamp":1781534361067}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144025Z-1662838.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144025Z-1662838.md new file mode 100644 index 0000000000000000000000000000000000000000..a40fd610e7e72cf676e2c7283c82d899679fe927 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144025Z-1662838.md @@ -0,0 +1,387 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144025Z-1662838.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144025Z-1662838.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144025Z-1662838.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838/2026-06-15T14-40-26-897Z_019ecbba-0711-705a-b504-423a39cc2fe3.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838/2026-06-15T14-40-26-897Z_019ecbba-0711-705a-b504-423a39cc2fe3.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..2b8317954ec78e48772758ff8bcdff08dde3ead9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144025Z-1662838/2026-06-15T14-40-26-897Z_019ecbba-0711-705a-b504-423a39cc2fe3.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbba-0711-705a-b504-423a39cc2fe3","timestamp":"2026-06-15T14:40:26.897Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"11707e97","parentId":null,"timestamp":"2026-06-15T14:40:26.961Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"4218e6f9","parentId":"11707e97","timestamp":"2026-06-15T14:40:26.961Z","thinkingLevel":"off"} +{"type":"message","id":"68ad41f7","parentId":"4218e6f9","timestamp":"2026-06-15T14:40:26.965Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534426965}} +{"type":"message","id":"337002b7","parentId":"68ad41f7","timestamp":"2026-06-15T14:40:33.039Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"835954320","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6803,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6895,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534426977,"responseId":"chatcmpl-b5x5c8aupxxa1iv8wyxsk"}} +{"type":"message","id":"d2dcc7a2","parentId":"337002b7","timestamp":"2026-06-15T14:40:33.041Z","message":{"role":"toolResult","toolCallId":"835954320","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Skpq5m/final-output.json"},"isError":false,"timestamp":1781534433041}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144033Z-1662977.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144033Z-1662977.md new file mode 100644 index 0000000000000000000000000000000000000000..4f1f972458d4186c026fc4845165308b81eef4bc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144033Z-1662977.md @@ -0,0 +1,287 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144033Z-1662977.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144033Z-1662977.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144033Z-1662977.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977/2026-06-15T14-40-34-314Z_019ecbba-240a-732f-bbe4-71b6db765243.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977/2026-06-15T14-40-34-314Z_019ecbba-240a-732f-bbe4-71b6db765243.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..eef681954e67af7e3910088516fedc23d135bbdc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144033Z-1662977/2026-06-15T14-40-34-314Z_019ecbba-240a-732f-bbe4-71b6db765243.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbba-240a-732f-bbe4-71b6db765243","timestamp":"2026-06-15T14:40:34.314Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"186d532e","parentId":null,"timestamp":"2026-06-15T14:40:34.379Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"6dbe0601","parentId":"186d532e","timestamp":"2026-06-15T14:40:34.379Z","thinkingLevel":"off"} +{"type":"message","id":"d369123f","parentId":"6dbe0601","timestamp":"2026-06-15T14:40:34.383Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534434383}} +{"type":"message","id":"46115f55","parentId":"d369123f","timestamp":"2026-06-15T14:40:39.192Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5047,"output":76,"cacheRead":0,"cacheWrite":0,"totalTokens":5123,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534434399,"responseId":"chatcmpl-yiqq3wl5vuxd5d3ztwi5"}} +{"type":"message","id":"b6f31b18","parentId":"46115f55","timestamp":"2026-06-15T14:40:39.968Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534439967}} +{"type":"message","id":"54844843","parentId":"b6f31b18","timestamp":"2026-06-15T14:40:43.964Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"739640178","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5301,"output":86,"cacheRead":0,"cacheWrite":0,"totalTokens":5387,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534439985,"responseId":"chatcmpl-5vip811b3cx28469ljc1bv"}} +{"type":"message","id":"c26348d9","parentId":"54844843","timestamp":"2026-06-15T14:40:43.965Z","message":{"role":"toolResult","toolCallId":"739640178","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-uJiZHK/final-output.json"},"isError":false,"timestamp":1781534443965}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T143921Z-1659853.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T143921Z-1659853.md new file mode 100644 index 0000000000000000000000000000000000000000..48f04f7079a3b2f686d6aa3728ea4b55df494482 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T143921Z-1659853.md @@ -0,0 +1,338 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T143921Z-1659853.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T143921Z-1659853.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T143921Z-1659853.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853/2026-06-15T14-39-22-152Z_019ecbb9-0a28-7219-86f0-142c3f3a66f3.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853/2026-06-15T14-39-22-152Z_019ecbb9-0a28-7219-86f0-142c3f3a66f3.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..10af0acea45c89da58ba6bf85f29bbe19ffb11ab --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T143921Z-1659853/2026-06-15T14-39-22-152Z_019ecbb9-0a28-7219-86f0-142c3f3a66f3.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbb9-0a28-7219-86f0-142c3f3a66f3","timestamp":"2026-06-15T14:39:22.152Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"0468ce67","parentId":null,"timestamp":"2026-06-15T14:39:22.216Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"cc78104b","parentId":"0468ce67","timestamp":"2026-06-15T14:39:22.216Z","thinkingLevel":"off"} +{"type":"message","id":"f1ef37f1","parentId":"cc78104b","timestamp":"2026-06-15T14:39:22.220Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534362220}} +{"type":"message","id":"78b93c48","parentId":"f1ef37f1","timestamp":"2026-06-15T14:39:27.934Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5282,"output":95,"cacheRead":0,"cacheWrite":0,"totalTokens":5377,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534362235,"responseId":"chatcmpl-c9jt48ztlhg5vsz4kzrfhr"}} +{"type":"message","id":"73f14386","parentId":"78b93c48","timestamp":"2026-06-15T14:39:28.632Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534368632}} +{"type":"message","id":"d032fbd0","parentId":"73f14386","timestamp":"2026-06-15T14:39:33.493Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"937829264","name":"final_json","arguments":{"caveats":["The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5574,"output":105,"cacheRead":0,"cacheWrite":0,"totalTokens":5679,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534368647,"responseId":"chatcmpl-3ow8c2u458faindz7820cd"}} +{"type":"message","id":"8585d1bd","parentId":"d032fbd0","timestamp":"2026-06-15T14:39:33.494Z","message":{"role":"toolResult","toolCallId":"937829264","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-XEveZ9/final-output.json"},"isError":false,"timestamp":1781534373494}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/prompts/20260615T144147Z-1664974.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/prompts/20260615T144147Z-1664974.md new file mode 100644 index 0000000000000000000000000000000000000000..78fb15140375b65300905258107e9bb9fea5c7ac --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/prompts/20260615T144147Z-1664974.md @@ -0,0 +1,394 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/schemas/20260615T144147Z-1664974.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/schemas/20260615T144147Z-1664974.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/schemas/20260615T144147Z-1664974.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974/2026-06-15T14-41-48-731Z_019ecbbb-46bb-7c4a-9917-222f999ab697.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974/2026-06-15T14-41-48-731Z_019ecbbb-46bb-7c4a-9917-222f999ab697.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..51f0ee09cd68cee341d25500bb282c33ab96b5fd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-52126/sessions/20260615T144147Z-1664974/2026-06-15T14-41-48-731Z_019ecbbb-46bb-7c4a-9917-222f999ab697.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbb-46bb-7c4a-9917-222f999ab697","timestamp":"2026-06-15T14:41:48.731Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"7ddedff1","parentId":null,"timestamp":"2026-06-15T14:41:48.798Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"16e52155","parentId":"7ddedff1","timestamp":"2026-06-15T14:41:48.798Z","thinkingLevel":"off"} +{"type":"message","id":"04bc77b0","parentId":"16e52155","timestamp":"2026-06-15T14:41:48.803Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534508803}} +{"type":"message","id":"69d3450b","parentId":"04bc77b0","timestamp":"2026-06-15T14:41:53.582Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"324425767","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior."],"topics_of_interest":["exec_tools","agent_runtime"],"description":"This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, specifically addressing the high risk associated with shell execution."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5601,"output":91,"cacheRead":0,"cacheWrite":0,"totalTokens":5692,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534508818,"responseId":"chatcmpl-ga12t2qj9r5j4ms93klnyp"}} +{"type":"message","id":"defb7abf","parentId":"69d3450b","timestamp":"2026-06-15T14:41:53.584Z","message":{"role":"toolResult","toolCallId":"324425767","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-tnUhgJ/final-output.json"},"isError":false,"timestamp":1781534513584}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/prompts/20260615T144122Z-1664534.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/prompts/20260615T144122Z-1664534.md new file mode 100644 index 0000000000000000000000000000000000000000..492410cd110fcb930264985e0b2d4165db1e86e3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/prompts/20260615T144122Z-1664534.md @@ -0,0 +1,445 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/schemas/20260615T144122Z-1664534.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/schemas/20260615T144122Z-1664534.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/schemas/20260615T144122Z-1664534.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534/2026-06-15T14-41-23-121Z_019ecbba-e2b1-78e2-8a44-8a6ba5cae60a.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534/2026-06-15T14-41-23-121Z_019ecbba-e2b1-78e2-8a44-8a6ba5cae60a.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..cee76b41c56815adeb710e2d11dc89192a853a0f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-81443/sessions/20260615T144122Z-1664534/2026-06-15T14-41-23-121Z_019ecbba-e2b1-78e2-8a44-8a6ba5cae60a.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbba-e2b1-78e2-8a44-8a6ba5cae60a","timestamp":"2026-06-15T14:41:23.121Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"64745279","parentId":null,"timestamp":"2026-06-15T14:41:23.185Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"54e11e07","parentId":"64745279","timestamp":"2026-06-15T14:41:23.185Z","thinkingLevel":"off"} +{"type":"message","id":"efd605e3","parentId":"54e11e07","timestamp":"2026-06-15T14:41:23.192Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534483192}} +{"type":"message","id":"fd60df3a","parentId":"efd605e3","timestamp":"2026-06-15T14:41:29.574Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"410633017","name":"final_json","arguments":{"caveats":["The provided context is a large PR diff and body summary; the classification relies on the high-level description of fixes related to image generation providers and Windows shims."],"topics_of_interest":["gateway","model_serving"],"description":"This PR resolves issues with Windows QMD shims and guards provider-returned image URL downloads through a guarded HTTP path within the gateway context."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7313,"output":97,"cacheRead":0,"cacheWrite":0,"totalTokens":7410,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534483208,"responseId":"chatcmpl-1sjljb2r8cirxcrupsl8r"}} +{"type":"message","id":"e5f5cb01","parentId":"fd60df3a","timestamp":"2026-06-15T14:41:29.576Z","message":{"role":"toolResult","toolCallId":"410633017","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-rE5Dvk/final-output.json"},"isError":false,"timestamp":1781534489576}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/prompts/20260615T144050Z-1663260.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/prompts/20260615T144050Z-1663260.md new file mode 100644 index 0000000000000000000000000000000000000000..94cc5747e919b4f53fc56424699af1f635d5027e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/prompts/20260615T144050Z-1663260.md @@ -0,0 +1,435 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/schemas/20260615T144050Z-1663260.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/schemas/20260615T144050Z-1663260.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/schemas/20260615T144050Z-1663260.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260/2026-06-15T14-40-50-956Z_019ecbba-650c-7b60-a99d-b680671c23cb.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260/2026-06-15T14-40-50-956Z_019ecbba-650c-7b60-a99d-b680671c23cb.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..20b429afc3f023a927874c45e04ba393abcde887 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-84509/sessions/20260615T144050Z-1663260/2026-06-15T14-40-50-956Z_019ecbba-650c-7b60-a99d-b680671c23cb.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbba-650c-7b60-a99d-b680671c23cb","timestamp":"2026-06-15T14:40:50.956Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ba960dfb","parentId":null,"timestamp":"2026-06-15T14:40:51.018Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"daaa4f31","parentId":"ba960dfb","timestamp":"2026-06-15T14:40:51.018Z","thinkingLevel":"off"} +{"type":"message","id":"667539ab","parentId":"daaa4f31","timestamp":"2026-06-15T14:40:51.024Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534451023}} +{"type":"message","id":"e9245909","parentId":"667539ab","timestamp":"2026-06-15T14:40:57.862Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"738364374","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diffs related to ACP protocol handling, specifically concerning text preservation during tool use in 'final_only' delivery mode. The classification relies on the explicit mentions of ACP/tool interaction semantics."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6121,"output":115,"cacheRead":0,"cacheWrite":0,"totalTokens":6236,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534451038,"responseId":"chatcmpl-0b0kvsvh01rdk2z31jetkde"}} +{"type":"message","id":"9d75827d","parentId":"e9245909","timestamp":"2026-06-15T14:40:57.864Z","message":{"role":"toolResult","toolCallId":"738364374","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diffs related to ACP protocol handling, specifically concerning text preservation during tool use in 'final_only' delivery mode. The classification relies on the explicit mentions of ACP/tool interaction semantics.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781534457864}} +{"type":"message","id":"7f191989","parentId":"9d75827d","timestamp":"2026-06-15T14:41:03.171Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"471403263","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diffs related to ACP protocol handling, specifically concerning text preservation during tool use in 'final_only' delivery mode. The classification relies on the explicit mentions of ACP/tool interaction semantics."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6405,"output":115,"cacheRead":0,"cacheWrite":0,"totalTokens":6520,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534457865,"responseId":"chatcmpl-3bnq56v5qgm6kr9l2bjjmm"}} +{"type":"message","id":"9bd566d7","parentId":"7f191989","timestamp":"2026-06-15T14:41:03.172Z","message":{"role":"toolResult","toolCallId":"471403263","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diffs related to ACP protocol handling, specifically concerning text preservation during tool use in 'final_only' delivery mode. The classification relies on the explicit mentions of ACP/tool interaction semantics.\"\n ],\n \"description\": \"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534463172}} +{"type":"message","id":"3aa2aa42","parentId":"9bd566d7","timestamp":"2026-06-15T14:41:09.834Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe previous attempt failed due to a character limit on the `caveats` field. I will shorten the caveat while keeping the core meaning and re-submit using the same classification, as it is accurate based on the evidence (ACP protocol + tool interaction semantics)."},{"type":"toolCall","id":"539028946","name":"final_json","arguments":{"caveats":["Context shows ACP protocol changes related to text preservation during tool use in final_only mode."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6692,"output":143,"cacheRead":0,"cacheWrite":0,"totalTokens":6835,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534463173,"responseId":"chatcmpl-kxwrks0bpcrpt96z6osur9"}} +{"type":"message","id":"aeabad97","parentId":"3aa2aa42","timestamp":"2026-06-15T14:41:09.836Z","message":{"role":"toolResult","toolCallId":"539028946","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-HXYRtp/final-output.json"},"isError":false,"timestamp":1781534469836}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/prompts/20260615T144129Z-1664655.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/prompts/20260615T144129Z-1664655.md new file mode 100644 index 0000000000000000000000000000000000000000..6d0e1398dc4d971195f39a9269f111a6ab3c9a47 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/prompts/20260615T144129Z-1664655.md @@ -0,0 +1,396 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/schemas/20260615T144129Z-1664655.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/schemas/20260615T144129Z-1664655.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/schemas/20260615T144129Z-1664655.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655/2026-06-15T14-41-30-668Z_019ecbbb-002c-73a6-a79b-f36cb61128b0.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655/2026-06-15T14-41-30-668Z_019ecbbb-002c-73a6-a79b-f36cb61128b0.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..7fc99857ee0124f5b0549679c0caa31a40b76d25 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88504/sessions/20260615T144129Z-1664655/2026-06-15T14-41-30-668Z_019ecbbb-002c-73a6-a79b-f36cb61128b0.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbb-002c-73a6-a79b-f36cb61128b0","timestamp":"2026-06-15T14:41:30.668Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"f61a16ff","parentId":null,"timestamp":"2026-06-15T14:41:30.738Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"2b30c8ac","parentId":"f61a16ff","timestamp":"2026-06-15T14:41:30.738Z","thinkingLevel":"off"} +{"type":"message","id":"524c0ba3","parentId":"2b30c8ac","timestamp":"2026-06-15T14:41:30.742Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534490742}} +{"type":"message","id":"afdc92c3","parentId":"524c0ba3","timestamp":"2026-06-15T14:41:36.787Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"316005243","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6886,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6978,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534490754,"responseId":"chatcmpl-1i5poj07d38dltv8xx2zz"}} +{"type":"message","id":"829e80e1","parentId":"afdc92c3","timestamp":"2026-06-15T14:41:36.789Z","message":{"role":"toolResult","toolCallId":"316005243","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-95mVa9/final-output.json"},"isError":false,"timestamp":1781534496789}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/prompts/20260615T144136Z-1664799.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/prompts/20260615T144136Z-1664799.md new file mode 100644 index 0000000000000000000000000000000000000000..4bba17318b7478adb6112d6f361aafb115d198fd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/prompts/20260615T144136Z-1664799.md @@ -0,0 +1,296 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/schemas/20260615T144136Z-1664799.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/schemas/20260615T144136Z-1664799.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/schemas/20260615T144136Z-1664799.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799/2026-06-15T14-41-37-860Z_019ecbbb-1c44-7751-bae5-41e549d356b0.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799/2026-06-15T14-41-37-860Z_019ecbbb-1c44-7751-bae5-41e549d356b0.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..26c3f688fe95a0f2cbbf9faa47b357926681f3d1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-88875/sessions/20260615T144136Z-1664799/2026-06-15T14-41-37-860Z_019ecbbb-1c44-7751-bae5-41e549d356b0.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbb-1c44-7751-bae5-41e549d356b0","timestamp":"2026-06-15T14:41:37.860Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"af958900","parentId":null,"timestamp":"2026-06-15T14:41:37.923Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ac75f501","parentId":"af958900","timestamp":"2026-06-15T14:41:37.923Z","thinkingLevel":"off"} +{"type":"message","id":"5417be03","parentId":"ac75f501","timestamp":"2026-06-15T14:41:37.930Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534497929}} +{"type":"message","id":"794435e7","parentId":"5417be03","timestamp":"2026-06-15T14:41:42.775Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5130,"output":75,"cacheRead":0,"cacheWrite":0,"totalTokens":5205,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534497945,"responseId":"chatcmpl-s0u3yrrgc8aneei1ay2zwl"}} +{"type":"message","id":"138be4c9","parentId":"794435e7","timestamp":"2026-06-15T14:41:43.677Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534503676}} +{"type":"message","id":"c6700f45","parentId":"138be4c9","timestamp":"2026-06-15T14:41:47.627Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"722664274","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5382,"output":85,"cacheRead":0,"cacheWrite":0,"totalTokens":5467,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534503689,"responseId":"chatcmpl-5mp8ju4tv7d7n0fc45w1fh"}} +{"type":"message","id":"11d26283","parentId":"c6700f45","timestamp":"2026-06-15T14:41:47.629Z","message":{"role":"toolResult","toolCallId":"722664274","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-71MaSH/final-output.json"},"isError":false,"timestamp":1781534507629}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/prompts/20260615T144109Z-1664310.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/prompts/20260615T144109Z-1664310.md new file mode 100644 index 0000000000000000000000000000000000000000..5e4415fec5b5be3bf29b45b330bdd88ffe86f584 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/prompts/20260615T144109Z-1664310.md @@ -0,0 +1,347 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Discipline + +GitHub context is primary. When the title or body names a specific file, +function, provider rule, event, wrapper, or delivery path and the supplied +context leaves the central routing topic ambiguous, ground the classification +in the smallest available repository evidence. Treat labels and changed-file +lists as hints, not proof. If source evidence would not change the topic, +answer directly. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/schemas/20260615T144109Z-1664310.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/schemas/20260615T144109Z-1664310.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/schemas/20260615T144109Z-1664310.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310/2026-06-15T14-41-10-866Z_019ecbba-b2d2-73df-b36c-a59bbb87b44c.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310/2026-06-15T14-41-10-866Z_019ecbba-b2d2-73df-b36c-a59bbb87b44c.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..979ab9fd55515663158a49302d02d41445832be3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/evidence-light__openclaw-openclaw-91046/sessions/20260615T144109Z-1664310/2026-06-15T14-41-10-866Z_019ecbba-b2d2-73df-b36c-a59bbb87b44c.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbba-b2d2-73df-b36c-a59bbb87b44c","timestamp":"2026-06-15T14:41:10.866Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"b354258c","parentId":null,"timestamp":"2026-06-15T14:41:10.928Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"8087e691","parentId":"b354258c","timestamp":"2026-06-15T14:41:10.928Z","thinkingLevel":"off"} +{"type":"message","id":"a768126c","parentId":"8087e691","timestamp":"2026-06-15T14:41:10.935Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Discipline\n\nGitHub context is primary. When the title or body names a specific file,\nfunction, provider rule, event, wrapper, or delivery path and the supplied\ncontext leaves the central routing topic ambiguous, ground the classification\nin the smallest available repository evidence. Treat labels and changed-file\nlists as hints, not proof. If source evidence would not change the topic,\nanswer directly.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534470934}} +{"type":"message","id":"2b223d18","parentId":"a768126c","timestamp":"2026-06-15T14:41:16.543Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the agent runner logic and provider configuration changes, which are central to routing/runtime behavior.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5365,"output":93,"cacheRead":0,"cacheWrite":0,"totalTokens":5458,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534470946,"responseId":"chatcmpl-0uhkbpveymoqt6q00fvc9kr"}} +{"type":"message","id":"fa31ea28","parentId":"2b223d18","timestamp":"2026-06-15T14:41:17.259Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the agent runner logic and provider configuration changes, which are central to routing/runtime behavior.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534477258}} +{"type":"message","id":"4a526fb2","parentId":"fa31ea28","timestamp":"2026-06-15T14:41:21.985Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"743186894","name":"final_json","arguments":{"caveats":["The classification is based on the agent runner logic and provider configuration changes, which are central to routing/runtime behavior."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5653,"output":103,"cacheRead":0,"cacheWrite":0,"totalTokens":5756,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534477272,"responseId":"chatcmpl-mtytz6y8wgaabqt0nsvypp"}} +{"type":"message","id":"08420b73","parentId":"4a526fb2","timestamp":"2026-06-15T14:41:21.987Z","message":{"role":"toolResult","toolCallId":"743186894","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-BqjIEh/final-output.json"},"isError":false,"timestamp":1781534481987}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/prompts/20260615T144239Z-1665838.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/prompts/20260615T144239Z-1665838.md new file mode 100644 index 0000000000000000000000000000000000000000..14fc6f7d4179373aaf9fe443386242705353d62c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/prompts/20260615T144239Z-1665838.md @@ -0,0 +1,393 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/schemas/20260615T144239Z-1665838.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/schemas/20260615T144239Z-1665838.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/schemas/20260615T144239Z-1665838.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838/2026-06-15T14-42-40-737Z_019ecbbc-11e1-7505-b5a6-4f8af6d87fce.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838/2026-06-15T14-42-40-737Z_019ecbbc-11e1-7505-b5a6-4f8af6d87fce.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..0de862a8807f8f0d2af9153903cb0fecc37edb16 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-52126/sessions/20260615T144239Z-1665838/2026-06-15T14-42-40-737Z_019ecbbc-11e1-7505-b5a6-4f8af6d87fce.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbc-11e1-7505-b5a6-4f8af6d87fce","timestamp":"2026-06-15T14:42:40.737Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"3f6dc14d","parentId":null,"timestamp":"2026-06-15T14:42:40.799Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"7d15273d","parentId":"3f6dc14d","timestamp":"2026-06-15T14:42:40.799Z","thinkingLevel":"off"} +{"type":"message","id":"a688b39b","parentId":"7d15273d","timestamp":"2026-06-15T14:42:40.805Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534560805}} +{"type":"message","id":"480c0494","parentId":"a688b39b","timestamp":"2026-06-15T14:42:46.114Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"545438801","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent behavior. The full scope of the system is not visible."],"topics_of_interest":["exec_tools","agent_runtime"],"description":"This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level, specifically targeting dangerous command execution patterns within the agent runtime."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5597,"output":103,"cacheRead":0,"cacheWrite":0,"totalTokens":5700,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534560820,"responseId":"chatcmpl-csbrnd6if5aoma0j9h04nn"}} +{"type":"message","id":"51d79420","parentId":"480c0494","timestamp":"2026-06-15T14:42:46.115Z","message":{"role":"toolResult","toolCallId":"545438801","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-0y4nxf/final-output.json"},"isError":false,"timestamp":1781534566115}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/prompts/20260615T144213Z-1665396.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/prompts/20260615T144213Z-1665396.md new file mode 100644 index 0000000000000000000000000000000000000000..97ca30aaac53ad00284dd2b93a1db69bfac6ae07 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/prompts/20260615T144213Z-1665396.md @@ -0,0 +1,444 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/schemas/20260615T144213Z-1665396.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/schemas/20260615T144213Z-1665396.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/schemas/20260615T144213Z-1665396.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396/2026-06-15T14-42-14-960Z_019ecbbb-ad30-7be2-b980-1d09a71a0bb2.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396/2026-06-15T14-42-14-960Z_019ecbbb-ad30-7be2-b980-1d09a71a0bb2.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5ea09f9171813250c829ade12c5a14c1d1224018 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-81443/sessions/20260615T144213Z-1665396/2026-06-15T14-42-14-960Z_019ecbbb-ad30-7be2-b980-1d09a71a0bb2.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbb-ad30-7be2-b980-1d09a71a0bb2","timestamp":"2026-06-15T14:42:14.960Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"3083b2fa","parentId":null,"timestamp":"2026-06-15T14:42:15.030Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"cec77d5a","parentId":"3083b2fa","timestamp":"2026-06-15T14:42:15.030Z","thinkingLevel":"off"} +{"type":"message","id":"9ded49a2","parentId":"cec77d5a","timestamp":"2026-06-15T14:42:15.034Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534535034}} +{"type":"message","id":"767e89e9","parentId":"9ded49a2","timestamp":"2026-06-15T14:42:21.650Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"157357671","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and provider timeout handling, but the core routing issue seems related to how external URLs are handled during media generation."],"topics_of_interest":["gateway","model_serving"],"description":"This pull request fixes issues with Windows QMD shims and guards image URL downloads when parsing OpenAI-compatible responses through the gateway."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7309,"output":103,"cacheRead":0,"cacheWrite":0,"totalTokens":7412,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534535046,"responseId":"chatcmpl-cs5o9u593lgjng8yfkrtc"}} +{"type":"message","id":"287aefbe","parentId":"767e89e9","timestamp":"2026-06-15T14:42:21.653Z","message":{"role":"toolResult","toolCallId":"157357671","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-P6YdB0/final-output.json"},"isError":false,"timestamp":1781534541653}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/prompts/20260615T144153Z-1665096.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/prompts/20260615T144153Z-1665096.md new file mode 100644 index 0000000000000000000000000000000000000000..3bcbc1644997aaaf5a17e9812a62bb3abf9a5eaa --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/prompts/20260615T144153Z-1665096.md @@ -0,0 +1,434 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/schemas/20260615T144153Z-1665096.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/schemas/20260615T144153Z-1665096.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/schemas/20260615T144153Z-1665096.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096/2026-06-15T14-41-54-749Z_019ecbbb-5e3d-7c20-aa4e-f33d8a895769.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096/2026-06-15T14-41-54-749Z_019ecbbb-5e3d-7c20-aa4e-f33d8a895769.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..e907b26bbe1415cdd5a5e5bbe98f6fd7c3e3b549 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-84509/sessions/20260615T144153Z-1665096/2026-06-15T14-41-54-749Z_019ecbbb-5e3d-7c20-aa4e-f33d8a895769.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbb-5e3d-7c20-aa4e-f33d8a895769","timestamp":"2026-06-15T14:41:54.749Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"d7f8e367","parentId":null,"timestamp":"2026-06-15T14:41:54.811Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"690fe5e6","parentId":"d7f8e367","timestamp":"2026-06-15T14:41:54.811Z","thinkingLevel":"off"} +{"type":"message","id":"a55dbbe4","parentId":"690fe5e6","timestamp":"2026-06-15T14:41:54.815Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534514814}} +{"type":"message","id":"ad0d8b12","parentId":"a55dbbe4","timestamp":"2026-06-15T14:42:01.516Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"680120035","name":"final_json","arguments":{"caveats":["The provided GitHub context is a PR description and diff focusing on ACP protocol behavior for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the technical details of this fix."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset turn state during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6117,"output":112,"cacheRead":0,"cacheWrite":0,"totalTokens":6229,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534514830,"responseId":"chatcmpl-90pzukm02gta1y0b4gn7v"}} +{"type":"message","id":"be0ca287","parentId":"ad0d8b12","timestamp":"2026-06-15T14:42:01.517Z","message":{"role":"toolResult","toolCallId":"680120035","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-jd2pVO/final-output.json"},"isError":false,"timestamp":1781534521517}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/prompts/20260615T144221Z-1665555.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/prompts/20260615T144221Z-1665555.md new file mode 100644 index 0000000000000000000000000000000000000000..10db0f05065fbc17662d1b1d5db5dfdcedb47a7b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/prompts/20260615T144221Z-1665555.md @@ -0,0 +1,395 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/schemas/20260615T144221Z-1665555.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/schemas/20260615T144221Z-1665555.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/schemas/20260615T144221Z-1665555.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555/2026-06-15T14-42-22-735Z_019ecbbb-cb8f-719d-a1dc-c84a106debd3.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555/2026-06-15T14-42-22-735Z_019ecbbb-cb8f-719d-a1dc-c84a106debd3.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..11e3f4188063e9e514fc69580ba7888b69607a40 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88504/sessions/20260615T144221Z-1665555/2026-06-15T14-42-22-735Z_019ecbbb-cb8f-719d-a1dc-c84a106debd3.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbb-cb8f-719d-a1dc-c84a106debd3","timestamp":"2026-06-15T14:42:22.735Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"40270160","parentId":null,"timestamp":"2026-06-15T14:42:22.799Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"f679d174","parentId":"40270160","timestamp":"2026-06-15T14:42:22.799Z","thinkingLevel":"off"} +{"type":"message","id":"53f99d7c","parentId":"f679d174","timestamp":"2026-06-15T14:42:22.802Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534542802}} +{"type":"message","id":"ab1db302","parentId":"53f99d7c","timestamp":"2026-06-15T14:42:28.918Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"541523564","name":"final_json","arguments":{"caveats":["The provided GitHub context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6882,"output":94,"cacheRead":0,"cacheWrite":0,"totalTokens":6976,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534542814,"responseId":"chatcmpl-68m1zacrb5speyjxgpbr7"}} +{"type":"message","id":"0e50b682","parentId":"ab1db302","timestamp":"2026-06-15T14:42:28.919Z","message":{"role":"toolResult","toolCallId":"541523564","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gLhF7X/final-output.json"},"isError":false,"timestamp":1781534548919}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/prompts/20260615T144229Z-1665678.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/prompts/20260615T144229Z-1665678.md new file mode 100644 index 0000000000000000000000000000000000000000..b4c1cf7b87e2beec7e97886d1293520004efad1e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/prompts/20260615T144229Z-1665678.md @@ -0,0 +1,295 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/schemas/20260615T144229Z-1665678.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/schemas/20260615T144229Z-1665678.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/schemas/20260615T144229Z-1665678.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678/2026-06-15T14-42-30-096Z_019ecbbb-e850-7f5d-bd35-20f2dd519351.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678/2026-06-15T14-42-30-096Z_019ecbbb-e850-7f5d-bd35-20f2dd519351.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d9833cca97a54e8eda172df7165fb77fd743442b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-88875/sessions/20260615T144229Z-1665678/2026-06-15T14-42-30-096Z_019ecbbb-e850-7f5d-bd35-20f2dd519351.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbb-e850-7f5d-bd35-20f2dd519351","timestamp":"2026-06-15T14:42:30.096Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"b1c11992","parentId":null,"timestamp":"2026-06-15T14:42:30.163Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"0b22f081","parentId":"b1c11992","timestamp":"2026-06-15T14:42:30.163Z","thinkingLevel":"off"} +{"type":"message","id":"23870896","parentId":"0b22f081","timestamp":"2026-06-15T14:42:30.167Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534550167}} +{"type":"message","id":"53f6a372","parentId":"23870896","timestamp":"2026-06-15T14:42:34.831Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts with inline invariant notes.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5126,"output":71,"cacheRead":0,"cacheWrite":0,"totalTokens":5197,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534550183,"responseId":"chatcmpl-dr5tq2cse1ixjajhjfzzh"}} +{"type":"message","id":"590dd9e0","parentId":"53f6a372","timestamp":"2026-06-15T14:42:35.597Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts with inline invariant notes.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534555596}} +{"type":"message","id":"da10548d","parentId":"590dd9e0","timestamp":"2026-06-15T14:42:39.378Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"868243042","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts with inline invariant notes."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5370,"output":81,"cacheRead":0,"cacheWrite":0,"totalTokens":5451,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534555609,"responseId":"chatcmpl-m3ci2s465vdrnzfaufqx"}} +{"type":"message","id":"7c7b6497","parentId":"da10548d","timestamp":"2026-06-15T14:42:39.380Z","message":{"role":"toolResult","toolCallId":"868243042","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-DGfxYT/final-output.json"},"isError":false,"timestamp":1781534559380}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/prompts/20260615T144201Z-1665226.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/prompts/20260615T144201Z-1665226.md new file mode 100644 index 0000000000000000000000000000000000000000..41d956600222d760bf4b6429cfd65094f265babd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/prompts/20260615T144201Z-1665226.md @@ -0,0 +1,346 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source Grounding Check + +Before choosing topics, decide whether the item is about a named runtime path, +handler, wrapper, projection, provider predicate, or test expectation. For +those code-specific items, resolve only enough repository evidence to identify +the central behavior when the GitHub excerpt is partial or ambiguous. Keep the +inspection narrow and ignore implementation details that do not affect routing. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/schemas/20260615T144201Z-1665226.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/schemas/20260615T144201Z-1665226.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/schemas/20260615T144201Z-1665226.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226/2026-06-15T14-42-02-632Z_019ecbbb-7d08-709d-be4a-5c7bd02e9ac7.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226/2026-06-15T14-42-02-632Z_019ecbbb-7d08-709d-be4a-5c7bd02e9ac7.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..21b0eb651f3688385a32efa2cd92d8275e0324ee --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/source-grounding__openclaw-openclaw-91046/sessions/20260615T144201Z-1665226/2026-06-15T14-42-02-632Z_019ecbbb-7d08-709d-be4a-5c7bd02e9ac7.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbb-7d08-709d-be4a-5c7bd02e9ac7","timestamp":"2026-06-15T14:42:02.632Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"9c476a88","parentId":null,"timestamp":"2026-06-15T14:42:02.694Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ba49edc9","parentId":"9c476a88","timestamp":"2026-06-15T14:42:02.694Z","thinkingLevel":"off"} +{"type":"message","id":"f655004d","parentId":"ba49edc9","timestamp":"2026-06-15T14:42:02.699Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source Grounding Check\n\nBefore choosing topics, decide whether the item is about a named runtime path,\nhandler, wrapper, projection, provider predicate, or test expectation. For\nthose code-specific items, resolve only enough repository evidence to identify\nthe central behavior when the GitHub excerpt is partial or ambiguous. Keep the\ninspection narrow and ignore implementation details that do not affect routing.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534522698}} +{"type":"message","id":"cda70636","parentId":"f655004d","timestamp":"2026-06-15T14:42:08.305Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the provided PR description and diff, which focuses on runtime parameter handling within agent execution logic.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5361,"output":93,"cacheRead":0,"cacheWrite":0,"totalTokens":5454,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534522714,"responseId":"chatcmpl-6f2wjf958y5xu0chr7hben"}} +{"type":"message","id":"772b866e","parentId":"cda70636","timestamp":"2026-06-15T14:42:09.062Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the provided PR description and diff, which focuses on runtime parameter handling within agent execution logic.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534529061}} +{"type":"message","id":"6ae199bb","parentId":"772b866e","timestamp":"2026-06-15T14:42:13.842Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"972023282","name":"final_json","arguments":{"caveats":["The classification is based on the provided PR description and diff, which focuses on runtime parameter handling within agent execution logic."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5649,"output":103,"cacheRead":0,"cacheWrite":0,"totalTokens":5752,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534529074,"responseId":"chatcmpl-hx51y33w0xqmhcz2sp9k9q"}} +{"type":"message","id":"e0e541b8","parentId":"6ae199bb","timestamp":"2026-06-15T14:42:13.843Z","message":{"role":"toolResult","toolCallId":"972023282","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-lFZ5yk/final-output.json"},"isError":false,"timestamp":1781534533843}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/prompts/20260615T144331Z-1666678.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/prompts/20260615T144331Z-1666678.md new file mode 100644 index 0000000000000000000000000000000000000000..ae20ec850fa5ff2bcba6b4ebdcce380ea3581cf3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/prompts/20260615T144331Z-1666678.md @@ -0,0 +1,393 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/schemas/20260615T144331Z-1666678.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/schemas/20260615T144331Z-1666678.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/schemas/20260615T144331Z-1666678.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678/2026-06-15T14-43-32-008Z_019ecbbc-da27-7090-95c5-fa4704e70b6f.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678/2026-06-15T14-43-32-008Z_019ecbbc-da27-7090-95c5-fa4704e70b6f.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..c69d3b6e7d24b8ec125db3d51b44b52a8a71ca5e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-52126/sessions/20260615T144331Z-1666678/2026-06-15T14-43-32-008Z_019ecbbc-da27-7090-95c5-fa4704e70b6f.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbc-da27-7090-95c5-fa4704e70b6f","timestamp":"2026-06-15T14:43:32.008Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"2748536d","parentId":null,"timestamp":"2026-06-15T14:43:32.073Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"19fd4485","parentId":"2748536d","timestamp":"2026-06-15T14:43:32.073Z","thinkingLevel":"off"} +{"type":"message","id":"e0ea9325","parentId":"19fd4485","timestamp":"2026-06-15T14:43:32.077Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534612077}} +{"type":"message","id":"92796416","parentId":"e0ea9325","timestamp":"2026-06-15T14:43:37.824Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"122148527","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to loop detection logic for exec tools, which primarily concerns agent runtime behavior."],"topics_of_interest":["exec_tools","agent_runtime"],"description":"This PR extends loopDetection to escalate repeated identical 'exec' tool calls to critical alerts, addressing a gap in the generic repeat detector for dangerous execution commands."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5595,"output":94,"cacheRead":0,"cacheWrite":0,"totalTokens":5689,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534612094,"responseId":"chatcmpl-gtsbd57rl1garnghedq0b"}} +{"type":"message","id":"44e6ee0b","parentId":"92796416","timestamp":"2026-06-15T14:43:37.826Z","message":{"role":"toolResult","toolCallId":"122148527","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-Fp8C9b/final-output.json"},"isError":false,"timestamp":1781534617826}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/prompts/20260615T144306Z-1666263.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/prompts/20260615T144306Z-1666263.md new file mode 100644 index 0000000000000000000000000000000000000000..ccce241add9fe959a23a26ed6bbcf560c954f5de --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/prompts/20260615T144306Z-1666263.md @@ -0,0 +1,444 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/schemas/20260615T144306Z-1666263.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/schemas/20260615T144306Z-1666263.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/schemas/20260615T144306Z-1666263.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263/2026-06-15T14-43-07-224Z_019ecbbc-7958-72a1-80ae-0a871164b17b.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263/2026-06-15T14-43-07-224Z_019ecbbc-7958-72a1-80ae-0a871164b17b.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b30588d484bd58aa14f6b7b47d474a6d1648ae49 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-81443/sessions/20260615T144306Z-1666263/2026-06-15T14-43-07-224Z_019ecbbc-7958-72a1-80ae-0a871164b17b.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbc-7958-72a1-80ae-0a871164b17b","timestamp":"2026-06-15T14:43:07.224Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"4704597c","parentId":null,"timestamp":"2026-06-15T14:43:07.288Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e0e36a3e","parentId":"4704597c","timestamp":"2026-06-15T14:43:07.288Z","thinkingLevel":"off"} +{"type":"message","id":"b02ded47","parentId":"e0e36a3e","timestamp":"2026-06-15T14:43:07.292Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534587291}} +{"type":"message","id":"51070c28","parentId":"b02ded47","timestamp":"2026-06-15T14:43:12.718Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"715167409","name":"final_json","arguments":{"caveats":["The body content was heavily truncated, but the title and surrounding context provide sufficient evidence for classification."],"topics_of_interest":["gateway","memory"],"description":"This PR fixes Windows QMD shim paths and guards image URL downloads within provider implementations, affecting gateway and memory components."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7307,"output":76,"cacheRead":0,"cacheWrite":0,"totalTokens":7383,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534587303,"responseId":"chatcmpl-2mol1qmu70mf1a9s17zaat"}} +{"type":"message","id":"b527485e","parentId":"51070c28","timestamp":"2026-06-15T14:43:12.722Z","message":{"role":"toolResult","toolCallId":"715167409","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gwHfcw/final-output.json"},"isError":false,"timestamp":1781534592721}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/prompts/20260615T144246Z-1665951.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/prompts/20260615T144246Z-1665951.md new file mode 100644 index 0000000000000000000000000000000000000000..378343a27d3353bb5473cdd0152fa7d528b10f7a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/prompts/20260615T144246Z-1665951.md @@ -0,0 +1,434 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/schemas/20260615T144246Z-1665951.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/schemas/20260615T144246Z-1665951.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/schemas/20260615T144246Z-1665951.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951/2026-06-15T14-42-47-221Z_019ecbbc-2b35-780e-a987-8a55eae9f3db.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951/2026-06-15T14-42-47-221Z_019ecbbc-2b35-780e-a987-8a55eae9f3db.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a72e012d8910a8afc9eb8dff0c3ee4f82396387e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-84509/sessions/20260615T144246Z-1665951/2026-06-15T14-42-47-221Z_019ecbbc-2b35-780e-a987-8a55eae9f3db.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbc-2b35-780e-a987-8a55eae9f3db","timestamp":"2026-06-15T14:42:47.221Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"5d670865","parentId":null,"timestamp":"2026-06-15T14:42:47.286Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"c69d4902","parentId":"5d670865","timestamp":"2026-06-15T14:42:47.286Z","thinkingLevel":"off"} +{"type":"message","id":"719048f6","parentId":"c69d4902","timestamp":"2026-06-15T14:42:47.290Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534567290}} +{"type":"message","id":"a2e48e73","parentId":"719048f6","timestamp":"2026-06-15T14:42:53.271Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"764916026","name":"final_json","arguments":{"caveats":["The body content was heavily truncated, but the core issue described relates to text preservation during tool use in 'final_only' delivery mode."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate done events prematurely flush and reset the turn state."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6115,"output":96,"cacheRead":0,"cacheWrite":0,"totalTokens":6211,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534567305,"responseId":"chatcmpl-rtg6go3z9edybqbyrqpxu8"}} +{"type":"message","id":"d387fe3a","parentId":"a2e48e73","timestamp":"2026-06-15T14:42:53.273Z","message":{"role":"toolResult","toolCallId":"764916026","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-UFf4gY/final-output.json"},"isError":false,"timestamp":1781534573273}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/prompts/20260615T144312Z-1666377.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/prompts/20260615T144312Z-1666377.md new file mode 100644 index 0000000000000000000000000000000000000000..c365e69c3d23f87bd669961e788b55cf1e027c73 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/prompts/20260615T144312Z-1666377.md @@ -0,0 +1,395 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/schemas/20260615T144312Z-1666377.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/schemas/20260615T144312Z-1666377.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/schemas/20260615T144312Z-1666377.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377/2026-06-15T14-43-13-831Z_019ecbbc-9327-795a-8fd1-df920df156c9.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377/2026-06-15T14-43-13-831Z_019ecbbc-9327-795a-8fd1-df920df156c9.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f19e2e7403196f90b90b99f48698a95dcdedafaf --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88504/sessions/20260615T144312Z-1666377/2026-06-15T14-43-13-831Z_019ecbbc-9327-795a-8fd1-df920df156c9.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbc-9327-795a-8fd1-df920df156c9","timestamp":"2026-06-15T14:43:13.831Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"40d303c4","parentId":null,"timestamp":"2026-06-15T14:43:13.896Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"0bf6427e","parentId":"40d303c4","timestamp":"2026-06-15T14:43:13.896Z","thinkingLevel":"off"} +{"type":"message","id":"bfe63283","parentId":"0bf6427e","timestamp":"2026-06-15T14:43:13.900Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534593900}} +{"type":"message","id":"2d6dae3a","parentId":"bfe63283","timestamp":"2026-06-15T14:43:19.917Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"160708551","name":"final_json","arguments":{"caveats":["The body content was heavily truncated, but the title and surrounding context clearly indicate a change to memory slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6880,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6972,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534593911,"responseId":"chatcmpl-j0prx64hn64yefs5n077f"}} +{"type":"message","id":"4b40fd13","parentId":"2d6dae3a","timestamp":"2026-06-15T14:43:19.918Z","message":{"role":"toolResult","toolCallId":"160708551","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-hhuiSV/final-output.json"},"isError":false,"timestamp":1781534599918}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/prompts/20260615T144320Z-1666513.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/prompts/20260615T144320Z-1666513.md new file mode 100644 index 0000000000000000000000000000000000000000..2911fcda5c72e724ef858500684563cc02b5580d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/prompts/20260615T144320Z-1666513.md @@ -0,0 +1,295 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/schemas/20260615T144320Z-1666513.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/schemas/20260615T144320Z-1666513.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/schemas/20260615T144320Z-1666513.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513/2026-06-15T14-43-21-063Z_019ecbbc-af67-7883-acdd-dc5c0ff84425.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513/2026-06-15T14-43-21-063Z_019ecbbc-af67-7883-acdd-dc5c0ff84425.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..7065e5a0dc5735cafddf5a988205b4b9ffab8047 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-88875/sessions/20260615T144320Z-1666513/2026-06-15T14-43-21-063Z_019ecbbc-af67-7883-acdd-dc5c0ff84425.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbc-af67-7883-acdd-dc5c0ff84425","timestamp":"2026-06-15T14:43:21.063Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"f308b8d5","parentId":null,"timestamp":"2026-06-15T14:43:21.128Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"11bb6c03","parentId":"f308b8d5","timestamp":"2026-06-15T14:43:21.128Z","thinkingLevel":"off"} +{"type":"message","id":"430e879c","parentId":"11bb6c03","timestamp":"2026-06-15T14:43:21.133Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534601132}} +{"type":"message","id":"1d27bfb1","parentId":"430e879c","timestamp":"2026-06-15T14:43:26.077Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The context mentions changes across many subsystems (markdown, gateway, channel, etc.), but the primary action is documentation cleanup.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5124,"output":78,"cacheRead":0,"cacheWrite":0,"totalTokens":5202,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534601148,"responseId":"chatcmpl-h8ox51z1bo72e4yt0ynny3"}} +{"type":"message","id":"1bc0c628","parentId":"1d27bfb1","timestamp":"2026-06-15T14:43:26.814Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The context mentions changes across many subsystems (markdown, gateway, channel, etc.), but the primary action is documentation cleanup.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534606813}} +{"type":"message","id":"d3f48d7a","parentId":"1bc0c628","timestamp":"2026-06-15T14:43:30.909Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"151192748","name":"final_json","arguments":{"caveats":["The context mentions changes across many subsystems (markdown, gateway, channel, etc.), but the primary action is documentation cleanup."],"topics_of_interest":["docs","gateway"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5382,"output":88,"cacheRead":0,"cacheWrite":0,"totalTokens":5470,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534606830,"responseId":"chatcmpl-6hb0on2depf4jzzqx2o3qm"}} +{"type":"message","id":"f2349ed9","parentId":"d3f48d7a","timestamp":"2026-06-15T14:43:30.911Z","message":{"role":"toolResult","toolCallId":"151192748","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-ZypWPX/final-output.json"},"isError":false,"timestamp":1781534610911}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/prompts/20260615T144253Z-1666071.md b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/prompts/20260615T144253Z-1666071.md new file mode 100644 index 0000000000000000000000000000000000000000..e422852865ea7db6af9b42edb0ff73d3e5172cca --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/prompts/20260615T144253Z-1666071.md @@ -0,0 +1,346 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Truncation And Evidence + +When the GitHub context says body, comments, file lists, or diffs were +truncated, avoid relying on broad labels alone. Prefer the nearest primary +repository evidence for the named file, function, or behavior if that evidence +could change the selected topic. If the available context already identifies +the maintainer bucket, continue without extra inspection. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/schemas/20260615T144253Z-1666071.json b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/schemas/20260615T144253Z-1666071.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/schemas/20260615T144253Z-1666071.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071/2026-06-15T14-42-54-448Z_019ecbbc-4770-7426-bb5b-910eac3ab305.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071/2026-06-15T14-42-54-448Z_019ecbbc-4770-7426-bb5b-910eac3ab305.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..3626fbdb34d06b75ded3e76b788a622f824373ab --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T143851Z/state/truncation-aware__openclaw-openclaw-91046/sessions/20260615T144253Z-1666071/2026-06-15T14-42-54-448Z_019ecbbc-4770-7426-bb5b-910eac3ab305.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbc-4770-7426-bb5b-910eac3ab305","timestamp":"2026-06-15T14:42:54.448Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"936c20b0","parentId":null,"timestamp":"2026-06-15T14:42:54.512Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"8aff54b8","parentId":"936c20b0","timestamp":"2026-06-15T14:42:54.512Z","thinkingLevel":"off"} +{"type":"message","id":"2e358bac","parentId":"8aff54b8","timestamp":"2026-06-15T14:42:54.519Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Truncation And Evidence\n\nWhen the GitHub context says body, comments, file lists, or diffs were\ntruncated, avoid relying on broad labels alone. Prefer the nearest primary\nrepository evidence for the named file, function, or behavior if that evidence\ncould change the selected topic. If the available context already identifies\nthe maintainer bucket, continue without extra inspection.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534574518}} +{"type":"message","id":"96ba9d97","parentId":"2e358bac","timestamp":"2026-06-15T14:43:00.259Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The context is truncated, but the core logic change in `extra-params.ts` and its corresponding test case are present.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5359,"output":96,"cacheRead":0,"cacheWrite":0,"totalTokens":5455,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534574534,"responseId":"chatcmpl-pykshjjfgdb3v6493iidhw"}} +{"type":"message","id":"380b81bd","parentId":"96ba9d97","timestamp":"2026-06-15T14:43:01.208Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The context is truncated, but the core logic change in `extra-params.ts` and its corresponding test case are present.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534581208}} +{"type":"message","id":"d93f5680","parentId":"380b81bd","timestamp":"2026-06-15T14:43:06.106Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"709595518","name":"final_json","arguments":{"caveats":["The context is truncated, but the core logic change in `extra-params.ts` and its corresponding test case are present."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5653,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":5759,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534581224,"responseId":"chatcmpl-4vdgnei0o6tig3pon44iwp"}} +{"type":"message","id":"9d6edf8e","parentId":"d93f5680","timestamp":"2026-06-15T14:43:06.108Z","message":{"role":"toolResult","toolCallId":"709595518","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T143851Z/agent-state/structured-output/run-gsXS36/final-output.json"},"isError":false,"timestamp":1781534586108}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/README.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a04179f5ecd757e61d97dc3f6e80582a1634dc96 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/README.md @@ -0,0 +1,91 @@ +# Reposhell Prompt Propensity Experiment + +Created: 2026-06-15T14:49:52.193Z + +Goal: test whether prompt wording can increase voluntary read-only repository inspection without explicitly naming or requiring the `bash` tool. + +## Setup + +- Model: `gemma-4-e4b-it` +- Target count: 6 +- Variant count: 4 +- Reposhell was exposed through the Localpager agent runtime. +- Localpager repo files were not edited; generated prompts, logs, sessions, and summaries are under this scratch experiment directory. + +## Summary + +| Variant | Runs | Sessions with bash | Successful bash sessions | Bash calls | Successful bash calls | Failures | Mean elapsed ms | +|---|---:|---:|---:|---:|---:|---:|---:| +| baseline | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 15138 | +| tool-aware-optional | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 12566 | +| one-lookup-budget | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 1 | 17148 | +| source-metadata-split | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 7244 | + +## Variants + +### baseline + +Baseline production prompt. + +### tool-aware-optional + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +### one-lookup-budget + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +### source-metadata-split + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Per-Run Results + +| Variant | Target | Status | Bash calls | Successful bash calls | Final JSON calls | Commands | +|---|---|---:|---:|---:|---:|---| +| baseline | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| tool-aware-optional | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| tool-aware-optional | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| tool-aware-optional | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| tool-aware-optional | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| tool-aware-optional | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| tool-aware-optional | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| one-lookup-budget | openclaw/openclaw#84509 | 2 | 0 | 0 | 3 | | +| one-lookup-budget | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| one-lookup-budget | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| one-lookup-budget | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| one-lookup-budget | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| one-lookup-budget | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#84509 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#81443 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| source-metadata-split | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | + +Full machine-readable output: `results.json`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/auth.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/auth.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/auth.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/models.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/models.json new file mode 100644 index 0000000000000000000000000000000000000000..9691cad056c66f40137e59d72ed52203186d894d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/models.json @@ -0,0 +1,31 @@ +{ + "providers": { + "local-openai": { + "baseUrl": "http://127.0.0.1:1234/v1", + "api": "openai-completions", + "apiKey": "local", + "compat": { + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "models": [ + { + "id": "gemma-4-e4b-it", + "name": "Local model (gemma-4-e4b-it)", + "reasoning": false, + "input": [ + "text" + ], + "contextWindow": 131072, + "maxTokens": 768, + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + } + } + ] + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/settings.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..87b89cc5721ad377c5b2c8ee1fd4e8bceb73d3ae --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/pi-config-runtime/settings.json @@ -0,0 +1,12 @@ +{ + "defaultProvider": "local-openai", + "defaultModel": "gemma-4-e4b-it", + "defaultThinkingLevel": "off", + "enableInstallTelemetry": false, + "quietStartup": true, + "compaction": { + "enabled": true, + "reserveTokens": 16384, + "keepRecentTokens": 20000 + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-10cFPR/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-10cFPR/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-10cFPR/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-3wwmFv/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-3wwmFv/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-3wwmFv/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-4u6oNA/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-4u6oNA/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-4u6oNA/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-6GclNM/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-6GclNM/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-6GclNM/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-7Jt79K/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-7Jt79K/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-7Jt79K/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-82wpdU/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-82wpdU/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-82wpdU/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-9BnDXN/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-9BnDXN/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-9BnDXN/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-CrHKkt/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-CrHKkt/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-CrHKkt/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-Fh3IHH/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-Fh3IHH/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-Fh3IHH/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-HvPEwL/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-HvPEwL/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-HvPEwL/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-IjhECI/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-IjhECI/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-IjhECI/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-KMeSM2/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-KMeSM2/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-KMeSM2/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-OcVCix/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-OcVCix/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-OcVCix/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-SRfhKK/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-SRfhKK/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-SRfhKK/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VLynjJ/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VLynjJ/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VLynjJ/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VSv0kJ/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VSv0kJ/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-VSv0kJ/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-YWWqu5/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-YWWqu5/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-YWWqu5/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-acpXAE/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-acpXAE/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-acpXAE/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-dozO1y/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-dozO1y/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-dozO1y/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-ftPErt/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-ftPErt/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-ftPErt/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-rR5uuG/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-rR5uuG/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-rR5uuG/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-tvSH4P/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-tvSH4P/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-tvSH4P/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-uC0zZF/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-uC0zZF/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-uC0zZF/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-usQbYv/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-usQbYv/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/reposhell/run-usQbYv/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-37Cyrl/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-37Cyrl/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-37Cyrl/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-3AkpDB/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-3AkpDB/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-3AkpDB/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-5YIK4T/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-5YIK4T/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-5YIK4T/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-6p3tXa/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-6p3tXa/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-6p3tXa/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-76MN4L/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-76MN4L/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-76MN4L/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-A3WqyE/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-A3WqyE/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-A3WqyE/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-MvrPbI/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-MvrPbI/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-MvrPbI/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OGxle7/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OGxle7/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OGxle7/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OMZia0/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OMZia0/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-OMZia0/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-T19bZ1/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-T19bZ1/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-T19bZ1/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-Ux2c8f/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-Ux2c8f/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-Ux2c8f/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-dtF8Ym/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-dtF8Ym/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-dtF8Ym/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-ef9j05/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-ef9j05/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-ef9j05/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-elqaLd/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-elqaLd/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-elqaLd/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-gr8nIJ/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-gr8nIJ/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-gr8nIJ/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-i7OJh3/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-i7OJh3/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-i7OJh3/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-j96suZ/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-j96suZ/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-j96suZ/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-jwlq4V/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-jwlq4V/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-jwlq4V/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-lRH6fd/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-lRH6fd/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-lRH6fd/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-neak1c/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-neak1c/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-neak1c/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-tsZjKe/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-tsZjKe/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-tsZjKe/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-u5CWHw/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-u5CWHw/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-u5CWHw/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-wCYJPf/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-wCYJPf/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-wCYJPf/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-xJIKYg/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-xJIKYg/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/request-params/run-xJIKYg/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..af7700758385edd5ef22ed3ccc0669fc288e35d1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f54e5b80a6e6da3bec578925561e5e1a489bb065 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The context is a documentation update (PR title: docs: document markdown and shared helpers), but it touches many subsystems like gateway, cli, and agents." + ], + "topics_of_interest": [ + "docs" + ], + "description": "This PR focuses on adding public/API documentation and invariant notes across various parts of the codebase, including markdown, gateway, and CLI helpers." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7f3fb5ca146d66d0ae57d3655e4d3172d79eae4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..70350a9486de254ad49530a6825fded29b1de37d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9fc3d8cf47cf2eefb27c5cd351c8afa717426b2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..5ebe027c4849f218f96fe370969c6984d231ceea --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate a major architectural change to memory slot configuration." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca1a42e93951d0d3c82e5ba354a81b537380b12c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..2f6cee7d112f17dffaf2c3a3f48c8335c7703c0d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level at the configured threshold." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3593670ccb2ec96d63bd3ae9681edd7e48a1fd6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..b9fe8410ef05145c26ca12cb7b57f596b885a9f4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context is PR diff fixing ACP text loss before tool calls in final_only mode." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd47b7e9e9c20d6209e8f999f10d251b902c8c2f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..e90156cc7d7dec577db8b3a8716dcf9738dfe599 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..7388cc8a9b06a2a5ce9d9fdb9458cd25ab960aa1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1091dca5d95308e439d7e5b9a200e5d42158cf --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..27282f5bd5abf24de5aaed7b06b10042570ce198 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the provided PR description and code changes, which focus on agent parameter handling related to specific model providers." + ], + "topics_of_interest": [ + "coding_agents", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9778e687f1036c4c99c789513f22d2824eb1a2c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..65f2b226df2d1e8ea368c302eb4a00b8cdb37f36 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level for safety." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..69db0040869dff79d9b0f4b06e68ce7d4e4ae465 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..21e37bbd7cfe661a53902c26154b0125dd4c01e7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body mentions a fix related to provider ID matching for DeepSeek V4 thinking wrapper, which relates to agent runtime behavior when interacting with specific providers." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers from Microsoft Foundry were incorrectly routed through a DeepSeek V4 thinking wrapper due to an exact provider ID match check." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..433ce78ecf1cf88bdcb0f86cf288281a4239b0c8 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..3256fc4e1c0079cd9be54ff1b1884e4353d64f17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate documentation updates." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR documents markdown and shared helpers across various components including gateway client and channel logic." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..f50d532911e36747d2d58862e16b185510ab8d68 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..fc874df7a9df3d94150566b3678f8e7d0513f6c3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the core issue description and code changes related to ACP delivery modes are present." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "In final_only ACP delivery mode, text output preceding tool calls was lost because intermediate 'done' events prematurely flushed and reset the turn state, which is fixed by preserving accumulated state during partial resets." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RkyCMV/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RkyCMV/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..c95b9d64839aab7b35ab83062c1cb8e4a945522f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RkyCMV/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RkyCMV/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..a71247b9c9c087eec1b21a37e4b5d44a026ab745 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..e907933c8c9a5815ab7d83cda3363bdcbd86aa64 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..9436917c0dfb06408fb26dfa535348718a5f8899 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..4a42ef90a83a0205ba7731c77cc8be7d3c3b8df5 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate changes related to image URL handling and provider interactions." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..85e401aaabd4833ccdf66b5a06dcaee83856ebeb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..97c35a59dd3c250da5ca988ab97f763ef4ffedec --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses Windows shim fixes and robust handling of image URLs from OpenAI-compatible providers, focusing on guarded HTTP downloads and timeouts for provider responses." + ], + "description": "This PR implements guarded HTTP downloading with bounded reads and operation deadlines for image URLs returned by OpenAI-compatible providers.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0200b26e952e6fb77a986abb68e8c73185ac49f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..339f925bb818eee943778667a179df9b3f718c6e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "PR covers Windows shims, image URL parsing for OpenAI providers, and guarded HTTP downloads. Classification focuses on provider routing and serving behavior." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.", + "topics_of_interest": [ + "model_serving", + "gateway" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..2112c0de941aa8275eb1a701fa24e04944dcfb1d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..16aa3a24afffd28d91598870f710b4c5bee202a7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a pull request focused heavily on documentation updates rather than a specific functional bug or feature implementation." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts with inline comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..85b9949a3b89ca4628942487b60a0dedfa53a8be --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..a8affd5424060dc306d1f806320234351be34ff3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the fix addressing provider routing logic within the embedded agent runner." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field during agent execution." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..37990c38602e28c93c8fd7bf7964cd80ca27725b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..117889437c33e10886035f4b9424aaef555ada05 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff snippets; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "tool_calling", + "reliability" + ], + "description": "This PR enhances loop detection to escalate repeated identical 'exec' tool calls to a critical alert level, improving system reliability against runaway commands." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..598b4a2108855742689389c0b4d8f29ca1bfd3c6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b27554d72dbeec473bd96fc0a2356493e0a5efd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-52126.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-52126.md new file mode 100644 index 0000000000000000000000000000000000000000..be82df8a4351d2b4acfe88676c058f3073716dc6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-52126.md @@ -0,0 +1,168 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-81443.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-81443.md new file mode 100644 index 0000000000000000000000000000000000000000..7b178accfcec455ab65201d98961ef0470f78992 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-81443.md @@ -0,0 +1,219 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-84509.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-84509.md new file mode 100644 index 0000000000000000000000000000000000000000..0223bcacf512af850ab96d12f6c8f91e7137bfdb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-84509.md @@ -0,0 +1,209 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88504.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88504.md new file mode 100644 index 0000000000000000000000000000000000000000..4ac10500b86ec809387c59d86e7e407f694f37e4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88504.md @@ -0,0 +1,170 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88875.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88875.md new file mode 100644 index 0000000000000000000000000000000000000000..83adcfc7633c6424cf576a6788f9bae1438680be --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88875.md @@ -0,0 +1,70 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-91046.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-91046.md new file mode 100644 index 0000000000000000000000000000000000000000..b03d107469f70f1647247a41a4adc60c58d42c99 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-91046.md @@ -0,0 +1,121 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4fa7b824120e8e43e830f805cc2859ad14988e3a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144604Z-1668363.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144604Z-1668363.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..acff9a1191b509274ec045e7bc8fc5a33e972380 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T144510Z-1667748.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T144510Z-1667748.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..a0e5d983c3620e8797ef483e9714296e6a7fc62b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T144439Z-1667349.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T144439Z-1667349.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..ed6fd9d011cd8e991584c2b42e6a6c4c93d76c13 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144548Z-1668098.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144548Z-1668098.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..4ee68e9f78466b16062a17e0adca738a910c89fb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144553Z-1668209.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144553Z-1668209.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..407ea573df8c0cf8477dc1a34a80bd105d43ed11 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T144457Z-1667564.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T144457Z-1667564.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..f08d2981a62381c1324e0a5ced64d4fe5ed3925e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/prompts/20260615T144902Z-1671517.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/schemas/20260615T144902Z-1671517.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..117889437c33e10886035f4b9424aaef555ada05 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff snippets; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "tool_calling", + "reliability" + ], + "description": "This PR enhances loop detection to escalate repeated identical 'exec' tool calls to a critical alert level, improving system reliability against runaway commands." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..c27674ea9cba6b54406ade49ceac142aa05ea1ce --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/prompts/20260615T144801Z-1670163.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/schemas/20260615T144801Z-1670163.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..97c35a59dd3c250da5ca988ab97f763ef4ffedec --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses Windows shim fixes and robust handling of image URLs from OpenAI-compatible providers, focusing on guarded HTTP downloads and timeouts for provider responses." + ], + "description": "This PR implements guarded HTTP downloading with bounded reads and operation deadlines for image URLs returned by OpenAI-compatible providers.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..fb6d7671d1a21a5c3ccd50ffd5800995419a9043 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,4 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/prompts/20260615T144725Z-1669511.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/schemas/20260615T144725Z-1669511.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511 +localpager-agent: final_json was not called; no structured output was captured diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..34939b601293682738e6e484fd7e09d2b8610f13 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/prompts/20260615T144843Z-1670689.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/schemas/20260615T144843Z-1670689.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..a92a850168498e0766bb5a9b695371be09f67cb0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/prompts/20260615T144850Z-1670828.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/schemas/20260615T144850Z-1670828.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f54e5b80a6e6da3bec578925561e5e1a489bb065 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The context is a documentation update (PR title: docs: document markdown and shared helpers), but it touches many subsystems like gateway, cli, and agents." + ], + "topics_of_interest": [ + "docs" + ], + "description": "This PR focuses on adding public/API documentation and invariant notes across various parts of the codebase, including markdown, gateway, and CLI helpers." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..aaab7a2a97cb5f6945fd7c2c9b115b35d04cc9ac --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/prompts/20260615T144750Z-1670001.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/schemas/20260615T144750Z-1670001.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..a8affd5424060dc306d1f806320234351be34ff3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the fix addressing provider routing logic within the embedded agent runner." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field during agent execution." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-52126.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-52126.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..8cd0f27b05d77527053f9cd4c7c5c3230bdc9004 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-52126.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-52126.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-52126.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-52126.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-81443.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-81443.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..66f210ef8787f080125ec100783a68b5d578479f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-81443.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-81443.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-81443.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-81443.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-84509.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-84509.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..0c8bb029e2365ded0f1d530d7a2358bd283cfef9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-84509.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-84509.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-84509.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-84509.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88504.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88504.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..00e05b275e0fdf96e4b795cf1bd01bbf134b5c3a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88504.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88504.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88504.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88504.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88875.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88875.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..440c2dc5bfba55c50f954e8a86ae46db1a16708f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88875.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-88875.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88875.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-88875.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-91046.context.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-91046.context.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..9372b5ed5ec9c9604de947c2e6e8f8f0132d0c46 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-91046.context.stderr.log @@ -0,0 +1 @@ +github_context: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/contexts/openclaw-openclaw-91046.md diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-91046.context.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/openclaw-openclaw-91046.context.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..cf23cb698ac6c38114e4e983627e50c19c1fc239 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/prompts/20260615T144946Z-1672450.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/schemas/20260615T144946Z-1672450.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..2f6cee7d112f17dffaf2c3a3f48c8335c7703c0d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level at the configured threshold." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..2ef6d27354651144932170242eca4d5042621d75 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/prompts/20260615T144923Z-1671934.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/schemas/20260615T144923Z-1671934.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..4a42ef90a83a0205ba7731c77cc8be7d3c3b8df5 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate changes related to image URL handling and provider interactions." + ], + "topics_of_interest": [ + "gateway", + "model_serving" + ], + "description": "This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..de176f78e30aec2f10990c0459288421d6a62459 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/prompts/20260615T144908Z-1671630.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/schemas/20260615T144908Z-1671630.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..fc874df7a9df3d94150566b3678f8e7d0513f6c3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the core issue description and code changes related to ACP delivery modes are present." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "In final_only ACP delivery mode, text output preceding tool calls was lost because intermediate 'done' events prematurely flushed and reset the turn state, which is fixed by preserving accumulated state during partial resets." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..c7d95874ca98f3a04e25ededb5249e5c9ea5e4ce --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/prompts/20260615T144929Z-1672049.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/schemas/20260615T144929Z-1672049.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..5ebe027c4849f218f96fe370969c6984d231ceea --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided GitHub context is heavily truncated, but the title and body clearly indicate a major architectural change to memory slot configuration." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..e66ef618b99ad51961c39debaeb9c9d089941e5e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/prompts/20260615T144937Z-1672207.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/schemas/20260615T144937Z-1672207.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..3256fc4e1c0079cd9be54ff1b1884e4353d64f17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate documentation updates." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR documents markdown and shared helpers across various components including gateway client and channel logic." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..68c914687f92b57614a3ea4f3202e29d41a833c0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/prompts/20260615T144916Z-1671774.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/schemas/20260615T144916Z-1671774.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..21e37bbd7cfe661a53902c26154b0125dd4c01e7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The body mentions a fix related to provider ID matching for DeepSeek V4 thinking wrapper, which relates to agent runtime behavior when interacting with specific providers." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers from Microsoft Foundry were incorrectly routed through a DeepSeek V4 thinking wrapper due to an exact provider ID match check." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..7695cdc841bb64ccb2a3bb17d347357cb1ed011e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/prompts/20260615T144720Z-1669400.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/schemas/20260615T144720Z-1669400.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..65f2b226df2d1e8ea368c302eb4a00b8cdb37f36 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level for safety." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..e839bd07965b0cdb79c19157b13ec3c400285aa3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/prompts/20260615T144642Z-1668877.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/schemas/20260615T144642Z-1668877.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..339f925bb818eee943778667a179df9b3f718c6e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "PR covers Windows shims, image URL parsing for OpenAI providers, and guarded HTTP downloads. Classification focuses on provider routing and serving behavior." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.", + "topics_of_interest": [ + "model_serving", + "gateway" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..d39d7034b99e061c7db70e79242aa55f2fcf0763 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/prompts/20260615T144610Z-1668473.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/schemas/20260615T144610Z-1668473.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..b9fe8410ef05145c26ca12cb7b57f596b885a9f4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context is PR diff fixing ACP text loss before tool calls in final_only mode." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..eaccd0ff0f5f0a92bda5342d981b29bded7857b0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/prompts/20260615T144702Z-1669099.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/schemas/20260615T144702Z-1669099.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e90156cc7d7dec577db8b3a8716dcf9738dfe599 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..091fe44a3e200ab10d8afbff6ed0fca9be3cfe6e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/prompts/20260615T144709Z-1669221.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/schemas/20260615T144709Z-1669221.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..16aa3a24afffd28d91598870f710b4c5bee202a7 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a pull request focused heavily on documentation updates rather than a specific functional bug or feature implementation." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts with inline comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..803ad4df55ceaa39f9960ce144ce83f73d2a4584 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/prompts/20260615T144629Z-1668708.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/schemas/20260615T144629Z-1668708.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..27282f5bd5abf24de5aaed7b06b10042570ce198 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the provided PR description and code changes, which focus on agent parameter handling related to specific model providers." + ], + "topics_of_interest": [ + "coding_agents", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/baseline.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/baseline.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..b5a47399be1f9bb46bb0ec18800b51bbafdf1132 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/baseline.prompt.md @@ -0,0 +1,138 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/one-lookup-budget.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/one-lookup-budget.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..59c0a4182d3efd3f237de3ed47a4f56b6efa57a2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/one-lookup-budget.prompt.md @@ -0,0 +1,146 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/source-metadata-split.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/source-metadata-split.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..8afdb574e024d87b0265397729bb45f30a22fc73 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/source-metadata-split.prompt.md @@ -0,0 +1,148 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/tool-aware-optional.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/tool-aware-optional.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..bd8448fdbabedb2389ef7253ecb84cea83d29f27 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/tool-aware-optional.prompt.md @@ -0,0 +1,148 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/results.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/results.json new file mode 100644 index 0000000000000000000000000000000000000000..efc1197efbf849bdb1c1dfe149f0995175019636 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/results.json @@ -0,0 +1,646 @@ +{ + "created_at": "2026-06-15T14:49:52.193Z", + "out_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z", + "localpager_root": "/home/bob/repos/localpager", + "model": "gemma-4-e4b-it", + "targets": [ + "openclaw/openclaw#84509", + "openclaw/openclaw#91046", + "openclaw/openclaw#81443", + "openclaw/openclaw#88504", + "openclaw/openclaw#88875", + "openclaw/openclaw#52126" + ], + "variants": [ + { + "name": "baseline", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/baseline.prompt.md", + "inserted_text": "" + }, + { + "name": "tool-aware-optional", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/tool-aware-optional.prompt.md", + "inserted_text": "## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n" + }, + { + "name": "one-lookup-budget", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/one-lookup-budget.prompt.md", + "inserted_text": "## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n" + }, + { + "name": "source-metadata-split", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/prompts/source-metadata-split.prompt.md", + "inserted_text": "## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n" + } + ], + "by_variant": [ + { + "variant": "baseline", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 15138.166666666666 + }, + { + "variant": "tool-aware-optional", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 12566.333333333334 + }, + { + "variant": "one-lookup-budget", + "runs": 6, + "failures": 1, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 17148.166666666668 + }, + { + "variant": "source-metadata-split", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 6, + "mean_elapsed_ms": 7244 + } + ], + "results": [ + { + "id": "baseline__openclaw-openclaw-84509", + "variant": "baseline", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 18091, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T144439Z-1667349.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T144439Z-1667349.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-40-612Z_019ecbbd-e624-7a38-a408-0a4c34e922dc.jsonl", + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-53-451Z_019ecbbe-184b-7b21-9612-e6ab1004cce4.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-91046", + "variant": "baseline", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12487, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T144457Z-1667564.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T144457Z-1667564.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564/2026-06-15T14-44-58-726Z_019ecbbe-2ce6-7b83-8d97-d44f875a8405.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-81443", + "variant": "baseline", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 38128, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T144510Z-1667748.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T144510Z-1667748.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748/2026-06-15T14-45-11-222Z_019ecbbe-5db6-74be-95b1-8ce5b4c28f7e.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88504", + "variant": "baseline", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 5500, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144548Z-1668098.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144548Z-1668098.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098/2026-06-15T14-45-49-308Z_019ecbbe-f27c-7624-b6dc-d1f91bd7e785.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88875", + "variant": "baseline", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10714, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144553Z-1668209.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144553Z-1668209.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209/2026-06-15T14-45-54-763Z_019ecbbf-07cb-70d1-b8e1-19d3fa6f0c82.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-52126", + "variant": "baseline", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5909, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144604Z-1668363.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144604Z-1668363.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/baseline__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363/2026-06-15T14-46-05-535Z_019ecbbf-31df-75f9-877e-bd64b359ba2b.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-84509", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 19424, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/prompts/20260615T144610Z-1668473.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/schemas/20260615T144610Z-1668473.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473/2026-06-15T14-46-11-373Z_019ecbbf-48ad-73e0-8a1c-765fa6ad3a0b.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-91046", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12439, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/prompts/20260615T144629Z-1668708.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/schemas/20260615T144629Z-1668708.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708/2026-06-15T14-46-30-795Z_019ecbbf-948b-7071-975e-0488bedeced1.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-81443", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 20387, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/prompts/20260615T144642Z-1668877.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/schemas/20260615T144642Z-1668877.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877/2026-06-15T14-46-43-511Z_019ecbbf-c637-7a5f-9a9b-23b53b430075.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-88504", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7263, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/prompts/20260615T144702Z-1669099.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/schemas/20260615T144702Z-1669099.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099/2026-06-15T14-47-03-667Z_019ecbc0-14f3-7f2c-aa61-63c9c2b807a5.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-88875", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10189, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/prompts/20260615T144709Z-1669221.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/schemas/20260615T144709Z-1669221.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221/2026-06-15T14-47-10-944Z_019ecbc0-3160-7517-8f67-8fc01dc5e407.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "tool-aware-optional__openclaw-openclaw-52126", + "variant": "tool-aware-optional", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5696, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/prompts/20260615T144720Z-1669400.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/schemas/20260615T144720Z-1669400.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/tool-aware-optional__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400/2026-06-15T14-47-21-082Z_019ecbc0-58fa-7177-a05a-9191448222ae.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-84509", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#84509", + "status": 2, + "elapsed_ms": 24683, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/prompts/20260615T144725Z-1669511.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/schemas/20260615T144725Z-1669511.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-27-048Z_019ecbc0-7048-7c13-867b-6037c2cc32c2.jsonl", + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-46-259Z_019ecbc0-bb53-7a4a-832d-3351d0480d68.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-91046", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 11102, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/prompts/20260615T144750Z-1670001.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/schemas/20260615T144750Z-1670001.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001/2026-06-15T14-47-51-533Z_019ecbc0-cfed-7385-b096-d07f4b28f210.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-81443", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 41988, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/prompts/20260615T144801Z-1670163.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/schemas/20260615T144801Z-1670163.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163/2026-06-15T14-48-02-664Z_019ecbc0-fb68-7b12-b6cd-f6f2eb580950.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-88504", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7259, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/prompts/20260615T144843Z-1670689.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/schemas/20260615T144843Z-1670689.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689/2026-06-15T14-48-44-618Z_019ecbc1-9f4a-70e5-9c7f-e463c19184e6.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-88875", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 11161, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/prompts/20260615T144850Z-1670828.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/schemas/20260615T144850Z-1670828.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828/2026-06-15T14-48-51-896Z_019ecbc1-bbb8-716d-9ffe-e360afbffb63.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "one-lookup-budget__openclaw-openclaw-52126", + "variant": "one-lookup-budget", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 6696, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/prompts/20260615T144902Z-1671517.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/schemas/20260615T144902Z-1671517.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/one-lookup-budget__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517/2026-06-15T14-49-03-028Z_019ecbc1-e734-71d4-ab5c-efa55b6f1e8c.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-84509", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 7412, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/prompts/20260615T144908Z-1671630.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/schemas/20260615T144908Z-1671630.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630/2026-06-15T14-49-09-730Z_019ecbc2-0162-7a54-8823-d27b69029b65.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-91046", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 7149, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/prompts/20260615T144916Z-1671774.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/schemas/20260615T144916Z-1671774.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774/2026-06-15T14-49-17-112Z_019ecbc2-1e38-72a3-8a67-2ad974043791.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-81443", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 6312, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/prompts/20260615T144923Z-1671934.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/schemas/20260615T144923Z-1671934.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934/2026-06-15T14-49-24-275Z_019ecbc2-3a33-705a-aab1-94b29e52f098.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-88504", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7471, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/prompts/20260615T144929Z-1672049.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/schemas/20260615T144929Z-1672049.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049/2026-06-15T14-49-30-641Z_019ecbc2-5311-77bc-b086-43cb46f2dc59.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-88875", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 9286, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/prompts/20260615T144937Z-1672207.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/schemas/20260615T144937Z-1672207.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207/2026-06-15T14-49-38-017Z_019ecbc2-6fe1-704c-a395-2e8c199f813f.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-metadata-split__openclaw-openclaw-52126", + "variant": "source-metadata-split", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5834, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/prompts/20260615T144946Z-1672450.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/schemas/20260615T144946Z-1672450.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/logs/source-metadata-split__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450/2026-06-15T14-49-47-377Z_019ecbc2-9471-7848-8cff-e6db0add9ecc.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + } + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144604Z-1668363.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144604Z-1668363.md new file mode 100644 index 0000000000000000000000000000000000000000..9913d2f4cdd5a722dca91f7cc4c8d3407b321905 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T144604Z-1668363.md @@ -0,0 +1,385 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144604Z-1668363.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144604Z-1668363.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T144604Z-1668363.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363/2026-06-15T14-46-05-535Z_019ecbbf-31df-75f9-877e-bd64b359ba2b.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363/2026-06-15T14-46-05-535Z_019ecbbf-31df-75f9-877e-bd64b359ba2b.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..9871738863ab0e9b81559faee849c752e6f31723 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T144604Z-1668363/2026-06-15T14-46-05-535Z_019ecbbf-31df-75f9-877e-bd64b359ba2b.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbf-31df-75f9-877e-bd64b359ba2b","timestamp":"2026-06-15T14:46:05.535Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"e1c75da4","parentId":null,"timestamp":"2026-06-15T14:46:05.601Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"6666e6eb","parentId":"e1c75da4","timestamp":"2026-06-15T14:46:05.601Z","thinkingLevel":"off"} +{"type":"message","id":"d60cf1dc","parentId":"6666e6eb","timestamp":"2026-06-15T14:46:05.606Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534765605}} +{"type":"message","id":"fb40a158","parentId":"d60cf1dc","timestamp":"2026-06-15T14:46:10.303Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"988519957","name":"final_json","arguments":{"caveats":["The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5518,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5607,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534765623,"responseId":"chatcmpl-ejitb0mj7zkuvg7byzq91m"}} +{"type":"message","id":"ece3cb65","parentId":"fb40a158","timestamp":"2026-06-15T14:46:10.306Z","message":{"role":"toolResult","toolCallId":"988519957","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-Wb7Zsy/final-output.json"},"isError":false,"timestamp":1781534770306}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T144510Z-1667748.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T144510Z-1667748.md new file mode 100644 index 0000000000000000000000000000000000000000..b3c6370238748f539d5e7fc6c020a583aa726e64 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T144510Z-1667748.md @@ -0,0 +1,436 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T144510Z-1667748.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T144510Z-1667748.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T144510Z-1667748.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748/2026-06-15T14-45-11-222Z_019ecbbe-5db6-74be-95b1-8ce5b4c28f7e.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748/2026-06-15T14-45-11-222Z_019ecbbe-5db6-74be-95b1-8ce5b4c28f7e.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..da8afb33c07a42c0f72d2429a7160fb2d4601cf6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T144510Z-1667748/2026-06-15T14-45-11-222Z_019ecbbe-5db6-74be-95b1-8ce5b4c28f7e.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbbe-5db6-74be-95b1-8ce5b4c28f7e","timestamp":"2026-06-15T14:45:11.222Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"e10f2ec3","parentId":null,"timestamp":"2026-06-15T14:45:11.291Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"84abeff1","parentId":"e10f2ec3","timestamp":"2026-06-15T14:45:11.291Z","thinkingLevel":"off"} +{"type":"message","id":"aa02d010","parentId":"84abeff1","timestamp":"2026-06-15T14:45:11.295Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534711294}} +{"type":"message","id":"e13ee023","parentId":"aa02d010","timestamp":"2026-06-15T14:45:17.997Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"989874647","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"topics_of_interest":["model_serving","gateway"],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7230,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":7336,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534711307,"responseId":"chatcmpl-b3jbz5sprfobqaz8xvdmth"}} +{"type":"message","id":"396450ca","parentId":"e13ee023","timestamp":"2026-06-15T14:45:17.999Z","message":{"role":"toolResult","toolCallId":"989874647","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\"\n}"}],"details":{},"isError":true,"timestamp":1781534717999}} +{"type":"message","id":"19b7b5e8","parentId":"396450ca","timestamp":"2026-06-15T14:45:22.736Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"915077880","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7496,"output":102,"cacheRead":0,"cacheWrite":0,"totalTokens":7598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534718000,"responseId":"chatcmpl-urbnwc1n87ia1p5dph3jai"}} +{"type":"message","id":"1c367504","parentId":"19b7b5e8","timestamp":"2026-06-15T14:45:22.737Z","message":{"role":"toolResult","toolCallId":"915077880","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\",\n \"topics_of_interest\": [\n \"model_serving\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534722737}} +{"type":"message","id":"f83c1606","parentId":"1c367504","timestamp":"2026-06-15T14:45:48.260Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe user wants me to classify a GitHub PR based on its title and body, routing it for maintainer notification.\nThe required output is a specific JSON structure.\n\nTitle: `fix: resolve QMD Windows shims and guard image URL downloads`\nLabels include: `docs`, `gateway`, `extensions: memory-core`, `agents`, etc.\nBody mentions:\n1. \"Resolve Windows `.cmd` shims...\" (OS/shim issue)\n2. \"Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\" (API parsing, related to model output handling)\n3. \"Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\" (This is key: routing/downloading from a provider URL).\n\nTopics analysis:\n- `model_serving`: Cues include \"streaming behavior, **routing**, lifecycle, and gateway behavi... cues: vllm\". The body explicitly mentions \"Route provider-returned image URLs through guarded HTTP...\" which strongly aligns with serving/routing behavior.\n- `gateway`: Mentioned in labels, and the PR touches on aspects related to how requests flow (though the core fix is about URL handling *after* a response).\n- `local_model_providers`: Not central; it's about handling URLs from providers, not setting up provider configuration/auth.\n\nThe most central theme for routing seems to be the secure handling and routing of external image URLs returned by an OpenAI-compatible provider, which falls under `model_serving`. The mention of \"gateway\" in labels is secondary to the functional fix described in the body regarding URL transport.\n\nI will select `model_serving` as the primary topic. I will keep the description concise and evidence-backed.\n\nRevisiting the previous attempt:\nThe first attempt used `[\"model_serving\", \"gateway\"]`. The second attempt used only `[\"model_serving\"]`. Given the strong focus on URL routing/downloading from a provider response, `model_serving` is sufficient and adheres to the rule of choosing the smallest set.\n\nI will use the refined single-topic classification."},{"type":"toolCall","id":"958498051","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7756,"output":567,"cacheRead":0,"cacheWrite":0,"totalTokens":8323,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534722737,"responseId":"chatcmpl-8jxdfel8y4f0n57ltf749io"}} +{"type":"message","id":"aa580dd6","parentId":"f83c1606","timestamp":"2026-06-15T14:45:48.262Z","message":{"role":"toolResult","toolCallId":"958498051","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-1pkoog/final-output.json"},"isError":false,"timestamp":1781534748261}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T144439Z-1667349.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T144439Z-1667349.md new file mode 100644 index 0000000000000000000000000000000000000000..181e17dac120c53b9cf4839a86ea6ea616b3ba29 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T144439Z-1667349.md @@ -0,0 +1,426 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T144439Z-1667349.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T144439Z-1667349.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T144439Z-1667349.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-40-612Z_019ecbbd-e624-7a38-a408-0a4c34e922dc.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-40-612Z_019ecbbd-e624-7a38-a408-0a4c34e922dc.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..8ff7346ddea1525d693bda393c98aec8bcf4929b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-40-612Z_019ecbbd-e624-7a38-a408-0a4c34e922dc.jsonl @@ -0,0 +1,9 @@ +{"type":"session","version":3,"id":"019ecbbd-e624-7a38-a408-0a4c34e922dc","timestamp":"2026-06-15T14:44:40.612Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"94f504c5","parentId":null,"timestamp":"2026-06-15T14:44:40.677Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e0f6fe3e","parentId":"94f504c5","timestamp":"2026-06-15T14:44:40.677Z","thinkingLevel":"off"} +{"type":"message","id":"eeb60402","parentId":"e0f6fe3e","timestamp":"2026-06-15T14:44:40.681Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534680681}} +{"type":"message","id":"7cc2ecce","parentId":"eeb60402","timestamp":"2026-06-15T14:44:47.621Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"204750701","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6038,"output":118,"cacheRead":0,"cacheWrite":0,"totalTokens":6156,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534680696,"responseId":"chatcmpl-a973gu1yez43srdz2bzczn"}} +{"type":"message","id":"02c36364","parentId":"7cc2ecce","timestamp":"2026-06-15T14:44:47.623Z","message":{"role":"toolResult","toolCallId":"204750701","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781534687623}} +{"type":"message","id":"6a25dd5a","parentId":"02c36364","timestamp":"2026-06-15T14:44:52.520Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"886079519","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"description":"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6328,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":6434,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534687623,"responseId":"chatcmpl-djp3rejwaoal7u1avt6lo"}} +{"type":"message","id":"8cd0aeb1","parentId":"6a25dd5a","timestamp":"2026-06-15T14:44:52.521Z","message":{"role":"toolResult","toolCallId":"886079519","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"description\": \"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534692521}} +{"type":"message","id":"3be69606","parentId":"8cd0aeb1","timestamp":"2026-06-15T14:44:52.765Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6597,"output":1,"cacheRead":0,"cacheWrite":0,"totalTokens":6598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534692522,"responseId":"chatcmpl-jqm2vliki0il660u347g9"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-53-451Z_019ecbbe-184b-7b21-9612-e6ab1004cce4.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-53-451Z_019ecbbe-184b-7b21-9612-e6ab1004cce4.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a3bd3f707a19f31bc4b448d5d3bcd56a37c856ad --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T144439Z-1667349/2026-06-15T14-44-53-451Z_019ecbbe-184b-7b21-9612-e6ab1004cce4.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbe-184b-7b21-9612-e6ab1004cce4","timestamp":"2026-06-15T14:44:53.451Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ce08668a","parentId":null,"timestamp":"2026-06-15T14:44:53.469Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"3a9e1345","parentId":"ce08668a","timestamp":"2026-06-15T14:44:53.469Z","thinkingLevel":"off"} +{"type":"message","id":"b7856c92","parentId":"3a9e1345","timestamp":"2026-06-15T14:44:53.474Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`.\n\nRetry instruction: your previous response did not call the final_json tool.\n\nDo not call bash. Do not explain anything in prose, markdown, or JSON text.\n\nCall final_json exactly once with a JSON object that matches the schema."}],"timestamp":1781534693474}} +{"type":"message","id":"cf35d43c","parentId":"b7856c92","timestamp":"2026-06-15T14:44:57.561Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"484827674","name":"final_json","arguments":{"caveats":["The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6089,"output":88,"cacheRead":0,"cacheWrite":0,"totalTokens":6177,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534693486,"responseId":"chatcmpl-kbyr1j38mgererv5dqvf3"}} +{"type":"message","id":"7caa3b65","parentId":"cf35d43c","timestamp":"2026-06-15T14:44:57.563Z","message":{"role":"toolResult","toolCallId":"484827674","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0lBEyk/final-output.json"},"isError":false,"timestamp":1781534697562}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144548Z-1668098.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144548Z-1668098.md new file mode 100644 index 0000000000000000000000000000000000000000..a40fd610e7e72cf676e2c7283c82d899679fe927 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T144548Z-1668098.md @@ -0,0 +1,387 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144548Z-1668098.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144548Z-1668098.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T144548Z-1668098.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098/2026-06-15T14-45-49-308Z_019ecbbe-f27c-7624-b6dc-d1f91bd7e785.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098/2026-06-15T14-45-49-308Z_019ecbbe-f27c-7624-b6dc-d1f91bd7e785.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a3efcc59657b9af71c7c98f92e1045347867ef52 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T144548Z-1668098/2026-06-15T14-45-49-308Z_019ecbbe-f27c-7624-b6dc-d1f91bd7e785.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbbe-f27c-7624-b6dc-d1f91bd7e785","timestamp":"2026-06-15T14:45:49.308Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"4b15cf2f","parentId":null,"timestamp":"2026-06-15T14:45:49.374Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"01b9021b","parentId":"4b15cf2f","timestamp":"2026-06-15T14:45:49.374Z","thinkingLevel":"off"} +{"type":"message","id":"6978e6b5","parentId":"01b9021b","timestamp":"2026-06-15T14:45:49.378Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534749377}} +{"type":"message","id":"535190cb","parentId":"6978e6b5","timestamp":"2026-06-15T14:45:53.679Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"511130669","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6803,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6895,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534749389,"responseId":"chatcmpl-f4td3dkdsy7johhmo5zgh"}} +{"type":"message","id":"19b9950e","parentId":"535190cb","timestamp":"2026-06-15T14:45:53.680Z","message":{"role":"toolResult","toolCallId":"511130669","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-EcNv4m/final-output.json"},"isError":false,"timestamp":1781534753680}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144553Z-1668209.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144553Z-1668209.md new file mode 100644 index 0000000000000000000000000000000000000000..4f1f972458d4186c026fc4845165308b81eef4bc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T144553Z-1668209.md @@ -0,0 +1,287 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144553Z-1668209.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144553Z-1668209.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T144553Z-1668209.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209/2026-06-15T14-45-54-763Z_019ecbbf-07cb-70d1-b8e1-19d3fa6f0c82.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209/2026-06-15T14-45-54-763Z_019ecbbf-07cb-70d1-b8e1-19d3fa6f0c82.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..66d59233ff4f91f2f08eb514f3d7d71fcf50ba72 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T144553Z-1668209/2026-06-15T14-45-54-763Z_019ecbbf-07cb-70d1-b8e1-19d3fa6f0c82.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbf-07cb-70d1-b8e1-19d3fa6f0c82","timestamp":"2026-06-15T14:45:54.763Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"960c7b95","parentId":null,"timestamp":"2026-06-15T14:45:54.827Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"587fb953","parentId":"960c7b95","timestamp":"2026-06-15T14:45:54.828Z","thinkingLevel":"off"} +{"type":"message","id":"c3f16b58","parentId":"587fb953","timestamp":"2026-06-15T14:45:54.834Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534754833}} +{"type":"message","id":"64f93473","parentId":"c3f16b58","timestamp":"2026-06-15T14:45:59.619Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5047,"output":76,"cacheRead":0,"cacheWrite":0,"totalTokens":5123,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534754846,"responseId":"chatcmpl-by2s6uytl1vfxh4j1vielq"}} +{"type":"message","id":"0ebd122a","parentId":"64f93473","timestamp":"2026-06-15T14:46:00.375Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534760374}} +{"type":"message","id":"ff6e23e3","parentId":"0ebd122a","timestamp":"2026-06-15T14:46:04.392Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"789688357","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5301,"output":86,"cacheRead":0,"cacheWrite":0,"totalTokens":5387,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534760391,"responseId":"chatcmpl-a3nh8jxr9srwsjqtdgctri"}} +{"type":"message","id":"f2621dcb","parentId":"ff6e23e3","timestamp":"2026-06-15T14:46:04.394Z","message":{"role":"toolResult","toolCallId":"789688357","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-vmYy1k/final-output.json"},"isError":false,"timestamp":1781534764393}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T144457Z-1667564.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T144457Z-1667564.md new file mode 100644 index 0000000000000000000000000000000000000000..48f04f7079a3b2f686d6aa3728ea4b55df494482 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T144457Z-1667564.md @@ -0,0 +1,338 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T144457Z-1667564.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T144457Z-1667564.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T144457Z-1667564.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564/2026-06-15T14-44-58-726Z_019ecbbe-2ce6-7b83-8d97-d44f875a8405.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564/2026-06-15T14-44-58-726Z_019ecbbe-2ce6-7b83-8d97-d44f875a8405.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..15931f9e90611e64decd7d93c2859446e61d0eba --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T144457Z-1667564/2026-06-15T14-44-58-726Z_019ecbbe-2ce6-7b83-8d97-d44f875a8405.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbe-2ce6-7b83-8d97-d44f875a8405","timestamp":"2026-06-15T14:44:58.726Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"2373d18f","parentId":null,"timestamp":"2026-06-15T14:44:58.792Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ad05fe76","parentId":"2373d18f","timestamp":"2026-06-15T14:44:58.792Z","thinkingLevel":"off"} +{"type":"message","id":"739d27c2","parentId":"ad05fe76","timestamp":"2026-06-15T14:44:58.796Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534698796}} +{"type":"message","id":"23271e1c","parentId":"739d27c2","timestamp":"2026-06-15T14:45:04.526Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5282,"output":95,"cacheRead":0,"cacheWrite":0,"totalTokens":5377,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534698812,"responseId":"chatcmpl-2g47ulhzwjq923jwxtdt8a"}} +{"type":"message","id":"05fdef40","parentId":"23271e1c","timestamp":"2026-06-15T14:45:05.236Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534705235}} +{"type":"message","id":"0f9a1afa","parentId":"05fdef40","timestamp":"2026-06-15T14:45:10.074Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"864920094","name":"final_json","arguments":{"caveats":["The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5574,"output":105,"cacheRead":0,"cacheWrite":0,"totalTokens":5679,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534705248,"responseId":"chatcmpl-izce15ua39ccdj4yx8fefi"}} +{"type":"message","id":"42570eda","parentId":"0f9a1afa","timestamp":"2026-06-15T14:45:10.076Z","message":{"role":"toolResult","toolCallId":"864920094","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-wJWjt9/final-output.json"},"isError":false,"timestamp":1781534710076}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/prompts/20260615T144902Z-1671517.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/prompts/20260615T144902Z-1671517.md new file mode 100644 index 0000000000000000000000000000000000000000..1722e4e14a4bae9ce73722924bc86987bc77fe2d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/prompts/20260615T144902Z-1671517.md @@ -0,0 +1,393 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/schemas/20260615T144902Z-1671517.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/schemas/20260615T144902Z-1671517.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/schemas/20260615T144902Z-1671517.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517/2026-06-15T14-49-03-028Z_019ecbc1-e734-71d4-ab5c-efa55b6f1e8c.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517/2026-06-15T14-49-03-028Z_019ecbc1-e734-71d4-ab5c-efa55b6f1e8c.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..fbebcd95df3b8285002285c8d22d0886a4d10c64 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-52126/sessions/20260615T144902Z-1671517/2026-06-15T14-49-03-028Z_019ecbc1-e734-71d4-ab5c-efa55b6f1e8c.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc1-e734-71d4-ab5c-efa55b6f1e8c","timestamp":"2026-06-15T14:49:03.028Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"306d9249","parentId":null,"timestamp":"2026-06-15T14:49:03.090Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"3dd9fa19","parentId":"306d9249","timestamp":"2026-06-15T14:49:03.090Z","thinkingLevel":"off"} +{"type":"message","id":"9ddc20e5","parentId":"3dd9fa19","timestamp":"2026-06-15T14:49:03.094Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534943094}} +{"type":"message","id":"dd03fb5c","parentId":"9ddc20e5","timestamp":"2026-06-15T14:49:08.592Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"741101995","name":"final_json","arguments":{"caveats":["The analysis relies on the provided PR description and diff snippets; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["tool_calling","reliability"],"description":"This PR enhances loop detection to escalate repeated identical 'exec' tool calls to a critical alert level, improving system reliability against runaway commands."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5607,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5696,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534943109,"responseId":"chatcmpl-6js4uwlb26u5xc21li4f83"}} +{"type":"message","id":"f0f7b5f4","parentId":"dd03fb5c","timestamp":"2026-06-15T14:49:08.593Z","message":{"role":"toolResult","toolCallId":"741101995","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-tUzMYr/final-output.json"},"isError":false,"timestamp":1781534948593}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/prompts/20260615T144801Z-1670163.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/prompts/20260615T144801Z-1670163.md new file mode 100644 index 0000000000000000000000000000000000000000..c5cfa0b9b60b81cc9b9f033bcc2def10ff935ac3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/prompts/20260615T144801Z-1670163.md @@ -0,0 +1,444 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/schemas/20260615T144801Z-1670163.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/schemas/20260615T144801Z-1670163.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/schemas/20260615T144801Z-1670163.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163/2026-06-15T14-48-02-664Z_019ecbc0-fb68-7b12-b6cd-f6f2eb580950.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163/2026-06-15T14-48-02-664Z_019ecbc0-fb68-7b12-b6cd-f6f2eb580950.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f5df2ce2341f7b9b6837608c9523aba6473cf6c5 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-81443/sessions/20260615T144801Z-1670163/2026-06-15T14-48-02-664Z_019ecbc0-fb68-7b12-b6cd-f6f2eb580950.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbc0-fb68-7b12-b6cd-f6f2eb580950","timestamp":"2026-06-15T14:48:02.664Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ba988b0a","parentId":null,"timestamp":"2026-06-15T14:48:02.730Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"6b43c009","parentId":"ba988b0a","timestamp":"2026-06-15T14:48:02.730Z","thinkingLevel":"off"} +{"type":"message","id":"b4ca0f5b","parentId":"6b43c009","timestamp":"2026-06-15T14:48:02.734Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534882734}} +{"type":"message","id":"df2f2e53","parentId":"b4ca0f5b","timestamp":"2026-06-15T14:48:09.714Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"428484004","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads with timeouts. The classification focuses on the core functional changes related to provider interaction and data handling."],"topics_of_interest":["model_serving","config"],"description":"This PR fixes issues related to Windows QMD shims and implements guarded HTTP downloading for image URLs returned by OpenAI-compatible providers, which involves configuration and serving logic."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7319,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":7430,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534882746,"responseId":"chatcmpl-8e3wkb6rgosp8avlhlr9o"}} +{"type":"message","id":"bf4068f1","parentId":"df2f2e53","timestamp":"2026-06-15T14:48:09.717Z","message":{"role":"toolResult","toolCallId":"428484004","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads with timeouts. The classification focuses on the core functional changes related to provider interaction and data handling.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"config\"\n ],\n \"description\": \"This PR fixes issues related to Windows QMD shims and implements guarded HTTP downloading for image URLs returned by OpenAI-compatible providers, which involves configuration and serving logic.\"\n}"}],"details":{},"isError":true,"timestamp":1781534889717}} +{"type":"message","id":"6843b3bf","parentId":"bf4068f1","timestamp":"2026-06-15T14:48:14.684Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"921484961","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads with timeouts. The classification focuses on the core functional changes related to provider interaction and data handling."],"description":"This PR fixes issues related to Windows QMD shims and implements guarded HTTP downloading for image URLs returned by OpenAI-compatible providers, which involves configuration and serving logic.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7595,"output":107,"cacheRead":0,"cacheWrite":0,"totalTokens":7702,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534889717,"responseId":"chatcmpl-2bpfcrqeo1n7kytp4ilu7"}} +{"type":"message","id":"ed890061","parentId":"6843b3bf","timestamp":"2026-06-15T14:48:14.685Z","message":{"role":"toolResult","toolCallId":"921484961","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads with timeouts. The classification focuses on the core functional changes related to provider interaction and data handling.\"\n ],\n \"description\": \"This PR fixes issues related to Windows QMD shims and implements guarded HTTP downloading for image URLs returned by OpenAI-compatible providers, which involves configuration and serving logic.\",\n \"topics_of_interest\": [\n \"model_serving\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534894685}} +{"type":"message","id":"3472abc6","parentId":"ed890061","timestamp":"2026-06-15T14:48:43.559Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe user wants me to classify a GitHub PR based on its title and body.\nThe goal is routing for maintainer notification, not code search.\nI must return only the final JSON structure.\n\nPR Title: `fix: resolve QMD Windows shims and guard image URL downloads`\nKey actions in Body:\n1. Resolve Windows `.cmd` shims (related to local environment/setup).\n2. Parse OpenAI-compatible image responses returning `data[].url` instead of `data[].b64_json`.\n3. Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n\nTopics analysis:\n- \"Windows QMD shims\": Relates to local environment/setup, potentially `local_models` or `config`.\n- \"Parse OpenAI-compatible image responses...\": This is about handling external API responses for model features (image generation).\n- \"Route provider-returned image URLs through guarded HTTP with bounded reads... operation-deadline timeouts\": This strongly points to how the service handles requests/responses from providers, which aligns well with `model_serving` or potentially `api_surface`. Given the context of routing and timeouts for external data fetching, `model_serving` is a strong fit.\n\nDecision:\n1. Main problem: Handling provider responses (image URLs) robustly via guarded HTTP downloads/timeouts. -> `model_serving`.\n2. Second topic? The Windows shim fix touches on local environment setup (`config`/`local_models`). However, the core *fix* described in detail is the URL guarding and timeout logic for external providers. I will stick to one primary topic if possible, as per rule 3 (\"Add a second topic only if the item would be misrouted without it\"). The image URL handling is central to how the service interacts with model endpoints/providers.\n\nI will select `model_serving` as the primary topic because the most complex and detailed fix involves request routing, timeouts, and data fetching from providers (OpenAI-compatible).\n\nCaveat refinement: Keep it concise (<240 chars).\n\nFinal check on topics:\n- `local_models`: No.\n- `local_model_providers`: No, this is about *serving* the response, not setting up the provider connection/auth itself.\n- `model_serving`: Yes, handling serving protocols/gateway behavior for external responses.\n- `config`: Could be argued due to \"configured media limits,\" but `model_serving` captures the *behavior* better.\n\nI will use one topic: `model_serving`."},{"type":"toolCall","id":"912211070","name":"final_json","arguments":{"caveats":["The PR addresses Windows shim fixes and robust handling of image URLs from OpenAI-compatible providers, focusing on guarded HTTP downloads and timeouts for provider responses."],"description":"This PR implements guarded HTTP downloading with bounded reads and operation deadlines for image URLs returned by OpenAI-compatible providers.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7865,"output":641,"cacheRead":0,"cacheWrite":0,"totalTokens":8506,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534894686,"responseId":"chatcmpl-eindx235fdudbfik6eof8v"}} +{"type":"message","id":"ee96c469","parentId":"3472abc6","timestamp":"2026-06-15T14:48:43.560Z","message":{"role":"toolResult","toolCallId":"912211070","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-gUNKUK/final-output.json"},"isError":false,"timestamp":1781534923560}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/prompts/20260615T144725Z-1669511.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/prompts/20260615T144725Z-1669511.md new file mode 100644 index 0000000000000000000000000000000000000000..c76ffe664d6a35f5225068971786de90562d228b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/prompts/20260615T144725Z-1669511.md @@ -0,0 +1,434 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/schemas/20260615T144725Z-1669511.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/schemas/20260615T144725Z-1669511.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/schemas/20260615T144725Z-1669511.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-27-048Z_019ecbc0-7048-7c13-867b-6037c2cc32c2.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-27-048Z_019ecbc0-7048-7c13-867b-6037c2cc32c2.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..ec63337416c1f21b12fc0dc6753fcaf12fe6bc90 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-27-048Z_019ecbc0-7048-7c13-867b-6037c2cc32c2.jsonl @@ -0,0 +1,11 @@ +{"type":"session","version":3,"id":"019ecbc0-7048-7c13-867b-6037c2cc32c2","timestamp":"2026-06-15T14:47:27.048Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"7015eed5","parentId":null,"timestamp":"2026-06-15T14:47:27.110Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"66bb7a5b","parentId":"7015eed5","timestamp":"2026-06-15T14:47:27.110Z","thinkingLevel":"off"} +{"type":"message","id":"06ccce79","parentId":"66bb7a5b","timestamp":"2026-06-15T14:47:27.114Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534847114}} +{"type":"message","id":"363ef10c","parentId":"06ccce79","timestamp":"2026-06-15T14:47:34.204Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"745896581","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode by preserving accumulated turn state across intermediate events."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6127,"output":121,"cacheRead":0,"cacheWrite":0,"totalTokens":6248,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534847129,"responseId":"chatcmpl-zreesgkvvho6rum6625rcb"}} +{"type":"message","id":"be27a838","parentId":"363ef10c","timestamp":"2026-06-15T14:47:34.206Z","message":{"role":"toolResult","toolCallId":"745896581","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode by preserving accumulated turn state across intermediate events.\"\n}"}],"details":{},"isError":true,"timestamp":1781534854206}} +{"type":"message","id":"aef854b2","parentId":"be27a838","timestamp":"2026-06-15T14:47:39.740Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"264766970","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available."],"description":"This change preserves pre-tool text output within the ACP protocol when using final_only delivery mode to prevent loss between intermediate events and tool execution.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6423,"output":120,"cacheRead":0,"cacheWrite":0,"totalTokens":6543,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534854206,"responseId":"chatcmpl-ld5ewgshcom0nvmuv6kx0v"}} +{"type":"message","id":"b229582d","parentId":"aef854b2","timestamp":"2026-06-15T14:47:39.741Z","message":{"role":"toolResult","toolCallId":"264766970","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available.\"\n ],\n \"description\": \"This change preserves pre-tool text output within the ACP protocol when using final_only delivery mode to prevent loss between intermediate events and tool execution.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534859741}} +{"type":"message","id":"6f912028","parentId":"b229582d","timestamp":"2026-06-15T14:47:45.290Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"240783969","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available."],"description":"This change preserves pre-tool text output within the ACP protocol when using final_only delivery mode to prevent loss between intermediate events and tool execution.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6720,"output":120,"cacheRead":0,"cacheWrite":0,"totalTokens":6840,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534859741,"responseId":"chatcmpl-n4k4333zp1882c3j6tj27s"}} +{"type":"message","id":"6e88889f","parentId":"6f912028","timestamp":"2026-06-15T14:47:45.291Z","message":{"role":"toolResult","toolCallId":"240783969","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification relies heavily on the cues present in the title and body, as the full scope of the system is not available.\"\n ],\n \"description\": \"This change preserves pre-tool text output within the ACP protocol when using final_only delivery mode to prevent loss between intermediate events and tool execution.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534865291}} +{"type":"message","id":"608a44b3","parentId":"6e88889f","timestamp":"2026-06-15T14:47:45.515Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7017,"output":1,"cacheRead":0,"cacheWrite":0,"totalTokens":7018,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534865291,"responseId":"chatcmpl-lvena7c7kpbbefacad1jr"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-46-259Z_019ecbc0-bb53-7a4a-832d-3351d0480d68.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-46-259Z_019ecbc0-bb53-7a4a-832d-3351d0480d68.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a194acb73d4ee90fd93955e56cedee74f0a857b9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-84509/sessions/20260615T144725Z-1669511/2026-06-15T14-47-46-259Z_019ecbc0-bb53-7a4a-832d-3351d0480d68.jsonl @@ -0,0 +1,5 @@ +{"type":"session","version":3,"id":"019ecbc0-bb53-7a4a-832d-3351d0480d68","timestamp":"2026-06-15T14:47:46.259Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"32d09ae3","parentId":null,"timestamp":"2026-06-15T14:47:46.277Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"9e3c3d66","parentId":"32d09ae3","timestamp":"2026-06-15T14:47:46.277Z","thinkingLevel":"off"} +{"type":"message","id":"4ed48fde","parentId":"9e3c3d66","timestamp":"2026-06-15T14:47:46.283Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`.\n\nRetry instruction: your previous response did not call the final_json tool.\n\nDo not call bash. Do not explain anything in prose, markdown, or JSON text.\n\nCall final_json exactly once with a JSON object that matches the schema."}],"timestamp":1781534866282}} +{"type":"message","id":"0faee113","parentId":"4ed48fde","timestamp":"2026-06-15T14:47:50.459Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\":[\"acp\",\"tool_calling\"],\"description\":\"The PR fixes an issue where pre-tool text is lost in `final_only` ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state, which is corrected by preserving accumulated state during partial resets.\",\"caveats\":[\"The context provided is a truncated diff/PR description; the full scope of changes might not be visible.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6178,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":6267,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534866295,"responseId":"chatcmpl-81pph10lz1bdmn0l7cuam5"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/prompts/20260615T144843Z-1670689.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/prompts/20260615T144843Z-1670689.md new file mode 100644 index 0000000000000000000000000000000000000000..7cded10c4710d39e4f6c9bdd7e4ab2c96b783352 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/prompts/20260615T144843Z-1670689.md @@ -0,0 +1,395 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/schemas/20260615T144843Z-1670689.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/schemas/20260615T144843Z-1670689.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/schemas/20260615T144843Z-1670689.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689/2026-06-15T14-48-44-618Z_019ecbc1-9f4a-70e5-9c7f-e463c19184e6.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689/2026-06-15T14-48-44-618Z_019ecbc1-9f4a-70e5-9c7f-e463c19184e6.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..ab55b281faaa9515dd731d088b88a5807074176d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88504/sessions/20260615T144843Z-1670689/2026-06-15T14-48-44-618Z_019ecbc1-9f4a-70e5-9c7f-e463c19184e6.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc1-9f4a-70e5-9c7f-e463c19184e6","timestamp":"2026-06-15T14:48:44.618Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"d1a04e04","parentId":null,"timestamp":"2026-06-15T14:48:44.683Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e710f773","parentId":"d1a04e04","timestamp":"2026-06-15T14:48:44.683Z","thinkingLevel":"off"} +{"type":"message","id":"62229d7f","parentId":"e710f773","timestamp":"2026-06-15T14:48:44.687Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534924686}} +{"type":"message","id":"03889429","parentId":"62229d7f","timestamp":"2026-06-15T14:48:50.763Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"600992790","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6892,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6984,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534924698,"responseId":"chatcmpl-pai9blsetyhgoyesai6l"}} +{"type":"message","id":"e86e99c5","parentId":"03889429","timestamp":"2026-06-15T14:48:50.765Z","message":{"role":"toolResult","toolCallId":"600992790","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fh0WEC/final-output.json"},"isError":false,"timestamp":1781534930764}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/prompts/20260615T144850Z-1670828.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/prompts/20260615T144850Z-1670828.md new file mode 100644 index 0000000000000000000000000000000000000000..fea30d366246bdf3302cffde5c8b33ee2ee339b9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/prompts/20260615T144850Z-1670828.md @@ -0,0 +1,295 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/schemas/20260615T144850Z-1670828.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/schemas/20260615T144850Z-1670828.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/schemas/20260615T144850Z-1670828.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828/2026-06-15T14-48-51-896Z_019ecbc1-bbb8-716d-9ffe-e360afbffb63.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828/2026-06-15T14-48-51-896Z_019ecbc1-bbb8-716d-9ffe-e360afbffb63.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..0b38d64a8e437abf2bd255c3e60827f05cfb0194 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-88875/sessions/20260615T144850Z-1670828/2026-06-15T14-48-51-896Z_019ecbc1-bbb8-716d-9ffe-e360afbffb63.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc1-bbb8-716d-9ffe-e360afbffb63","timestamp":"2026-06-15T14:48:51.896Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"b5e718d9","parentId":null,"timestamp":"2026-06-15T14:48:51.957Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e135e126","parentId":"b5e718d9","timestamp":"2026-06-15T14:48:51.957Z","thinkingLevel":"off"} +{"type":"message","id":"4ba7670b","parentId":"e135e126","timestamp":"2026-06-15T14:48:51.961Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534931961}} +{"type":"message","id":"2bdc5e17","parentId":"4ba7670b","timestamp":"2026-06-15T14:48:57.005Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\"], \"description\": \"This PR focuses on adding public/API documentation and invariant notes across various parts of the codebase, including markdown, gateway, and CLI helpers.\", \"caveats\": [\"The context is a documentation update (PR title: docs: document markdown and shared helpers), but it touches many subsystems like gateway, cli, and agents.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5136,"output":80,"cacheRead":0,"cacheWrite":0,"totalTokens":5216,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534931976,"responseId":"chatcmpl-hswdbvrcmvu2v6ythyxfma"}} +{"type":"message","id":"b4ab3ef4","parentId":"2bdc5e17","timestamp":"2026-06-15T14:48:57.749Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\"\n ],\n \"description\": \"This PR focuses on adding public/API documentation and invariant notes across various parts of the codebase, including markdown, gateway, and CLI helpers.\",\n \"caveats\": [\n \"The context is a documentation update (PR title: docs: document markdown and shared helpers), but it touches many subsystems like gateway, cli, and agents.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534937749}} +{"type":"message","id":"3706d578","parentId":"b4ab3ef4","timestamp":"2026-06-15T14:49:01.896Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"143006703","name":"final_json","arguments":{"caveats":["The context is a documentation update (PR title: docs: document markdown and shared helpers), but it touches many subsystems like gateway, cli, and agents."],"topics_of_interest":["docs"],"description":"This PR focuses on adding public/API documentation and invariant notes across various parts of the codebase, including markdown, gateway, and CLI helpers."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5396,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5485,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534937766,"responseId":"chatcmpl-n6lgwwwb9x6hg05mt8r48"}} +{"type":"message","id":"9a81da27","parentId":"3706d578","timestamp":"2026-06-15T14:49:01.897Z","message":{"role":"toolResult","toolCallId":"143006703","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-0euUWK/final-output.json"},"isError":false,"timestamp":1781534941897}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/prompts/20260615T144750Z-1670001.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/prompts/20260615T144750Z-1670001.md new file mode 100644 index 0000000000000000000000000000000000000000..04e64301d743df5c701bebc23f1a6ae1a3af89f8 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/prompts/20260615T144750Z-1670001.md @@ -0,0 +1,346 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Code-Specific Evidence Budget + +For code-specific PRs with truncated or selected context, spend at most one +focused repository lookup to confirm the named behavior before final +classification when that confirmation can distinguish `acp`, `tool_calling`, +`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the +title and body already settle the topic, skip the lookup. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/schemas/20260615T144750Z-1670001.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/schemas/20260615T144750Z-1670001.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/schemas/20260615T144750Z-1670001.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001/2026-06-15T14-47-51-533Z_019ecbc0-cfed-7385-b096-d07f4b28f210.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001/2026-06-15T14-47-51-533Z_019ecbc0-cfed-7385-b096-d07f4b28f210.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..85bcb723c9ab6bfe504c0c089de50a753a7372a1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/one-lookup-budget__openclaw-openclaw-91046/sessions/20260615T144750Z-1670001/2026-06-15T14-47-51-533Z_019ecbc0-cfed-7385-b096-d07f4b28f210.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc0-cfed-7385-b096-d07f4b28f210","timestamp":"2026-06-15T14:47:51.533Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ae1febab","parentId":null,"timestamp":"2026-06-15T14:47:51.596Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"fee89177","parentId":"ae1febab","timestamp":"2026-06-15T14:47:51.596Z","thinkingLevel":"off"} +{"type":"message","id":"65f0ef05","parentId":"fee89177","timestamp":"2026-06-15T14:47:51.602Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Code-Specific Evidence Budget\n\nFor code-specific PRs with truncated or selected context, spend at most one\nfocused repository lookup to confirm the named behavior before final\nclassification when that confirmation can distinguish `acp`, `tool_calling`,\n`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the\ntitle and body already settle the topic, skip the lookup.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534871602}} +{"type":"message","id":"9e7238d4","parentId":"65f0ef05","timestamp":"2026-06-15T14:47:56.605Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field during agent execution.\", \"caveats\": [\"The classification is based on the fix addressing provider routing logic within the embedded agent runner.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5371,"output":79,"cacheRead":0,"cacheWrite":0,"totalTokens":5450,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534871617,"responseId":"chatcmpl-k0f3fbut17cjnur1xjjqc"}} +{"type":"message","id":"d9e43c76","parentId":"9e7238d4","timestamp":"2026-06-15T14:47:57.336Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field during agent execution.\",\n \"caveats\": [\n \"The classification is based on the fix addressing provider routing logic within the embedded agent runner.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534877335}} +{"type":"message","id":"f11dbdbd","parentId":"d9e43c76","timestamp":"2026-06-15T14:48:01.492Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"153704079","name":"final_json","arguments":{"caveats":["The classification is based on the fix addressing provider routing logic within the embedded agent runner."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field during agent execution."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5631,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5720,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534877348,"responseId":"chatcmpl-ne7hrnadbtw9f3hzzci9f"}} +{"type":"message","id":"bbd30d8b","parentId":"f11dbdbd","timestamp":"2026-06-15T14:48:01.494Z","message":{"role":"toolResult","toolCallId":"153704079","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-k80KWJ/final-output.json"},"isError":false,"timestamp":1781534881493}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/prompts/20260615T144946Z-1672450.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/prompts/20260615T144946Z-1672450.md new file mode 100644 index 0000000000000000000000000000000000000000..33c306d6dfded7ae98a354f00b5cd4e0a19dc98e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/prompts/20260615T144946Z-1672450.md @@ -0,0 +1,395 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/schemas/20260615T144946Z-1672450.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/schemas/20260615T144946Z-1672450.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/schemas/20260615T144946Z-1672450.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450/2026-06-15T14-49-47-377Z_019ecbc2-9471-7848-8cff-e6db0add9ecc.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450/2026-06-15T14-49-47-377Z_019ecbc2-9471-7848-8cff-e6db0add9ecc.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..6305a0ee267ddb6dced1e7fab619de497bfd232b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-52126/sessions/20260615T144946Z-1672450/2026-06-15T14-49-47-377Z_019ecbc2-9471-7848-8cff-e6db0add9ecc.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc2-9471-7848-8cff-e6db0add9ecc","timestamp":"2026-06-15T14:49:47.377Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"55dc773b","parentId":null,"timestamp":"2026-06-15T14:49:47.442Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"0e098273","parentId":"55dc773b","timestamp":"2026-06-15T14:49:47.442Z","thinkingLevel":"off"} +{"type":"message","id":"a8cb2272","parentId":"0e098273","timestamp":"2026-06-15T14:49:47.447Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534987446}} +{"type":"message","id":"d694a407","parentId":"a8cb2272","timestamp":"2026-06-15T14:49:52.085Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"202987871","name":"final_json","arguments":{"caveats":["The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level at the configured threshold."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5617,"output":88,"cacheRead":0,"cacheWrite":0,"totalTokens":5705,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534987462,"responseId":"chatcmpl-odn89jaj3jr868lswhy4y5"}} +{"type":"message","id":"f2fd6fc9","parentId":"d694a407","timestamp":"2026-06-15T14:49:52.087Z","message":{"role":"toolResult","toolCallId":"202987871","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-B3EIEm/final-output.json"},"isError":false,"timestamp":1781534992086}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/prompts/20260615T144923Z-1671934.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/prompts/20260615T144923Z-1671934.md new file mode 100644 index 0000000000000000000000000000000000000000..6fbd69d0a01b2d98e58c33ccb6eaf2722d614cdf --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/prompts/20260615T144923Z-1671934.md @@ -0,0 +1,446 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/schemas/20260615T144923Z-1671934.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/schemas/20260615T144923Z-1671934.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/schemas/20260615T144923Z-1671934.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934/2026-06-15T14-49-24-275Z_019ecbc2-3a33-705a-aab1-94b29e52f098.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934/2026-06-15T14-49-24-275Z_019ecbc2-3a33-705a-aab1-94b29e52f098.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..064dbc46eb7f92bae49c814dbf8d2728c2d21e58 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-81443/sessions/20260615T144923Z-1671934/2026-06-15T14-49-24-275Z_019ecbc2-3a33-705a-aab1-94b29e52f098.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc2-3a33-705a-aab1-94b29e52f098","timestamp":"2026-06-15T14:49:24.275Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"f670614c","parentId":null,"timestamp":"2026-06-15T14:49:24.343Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"d7cb63fa","parentId":"f670614c","timestamp":"2026-06-15T14:49:24.343Z","thinkingLevel":"off"} +{"type":"message","id":"645f8c2b","parentId":"d7cb63fa","timestamp":"2026-06-15T14:49:24.346Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534964346}} +{"type":"message","id":"a3566f61","parentId":"645f8c2b","timestamp":"2026-06-15T14:49:29.489Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"258093281","name":"final_json","arguments":{"caveats":["The provided GitHub context is heavily truncated, but the title and body clearly indicate changes related to image URL handling and provider interactions."],"topics_of_interest":["gateway","model_serving"],"description":"This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7329,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":7418,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534964358,"responseId":"chatcmpl-drkfsgvmbpdt9pv9fcqd"}} +{"type":"message","id":"c2533c02","parentId":"a3566f61","timestamp":"2026-06-15T14:49:29.491Z","message":{"role":"toolResult","toolCallId":"258093281","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-fzR8QL/final-output.json"},"isError":false,"timestamp":1781534969490}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/prompts/20260615T144908Z-1671630.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/prompts/20260615T144908Z-1671630.md new file mode 100644 index 0000000000000000000000000000000000000000..b00c66fb98a89810ce09320c8c5182d0995b0b47 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/prompts/20260615T144908Z-1671630.md @@ -0,0 +1,436 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/schemas/20260615T144908Z-1671630.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/schemas/20260615T144908Z-1671630.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/schemas/20260615T144908Z-1671630.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630/2026-06-15T14-49-09-730Z_019ecbc2-0162-7a54-8823-d27b69029b65.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630/2026-06-15T14-49-09-730Z_019ecbc2-0162-7a54-8823-d27b69029b65.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..bb36f9304248cb1c154a1de10cc806bd3bfb974f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-84509/sessions/20260615T144908Z-1671630/2026-06-15T14-49-09-730Z_019ecbc2-0162-7a54-8823-d27b69029b65.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc2-0162-7a54-8823-d27b69029b65","timestamp":"2026-06-15T14:49:09.730Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"4d604ad3","parentId":null,"timestamp":"2026-06-15T14:49:09.793Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"68b89456","parentId":"4d604ad3","timestamp":"2026-06-15T14:49:09.793Z","thinkingLevel":"off"} +{"type":"message","id":"8510110b","parentId":"68b89456","timestamp":"2026-06-15T14:49:09.801Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534949800}} +{"type":"message","id":"8eb08e1a","parentId":"8510110b","timestamp":"2026-06-15T14:49:16.033Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"632244702","name":"final_json","arguments":{"caveats":["The provided GitHub context is heavily truncated, but the core issue description and code changes related to ACP delivery modes are present."],"topics_of_interest":["acp","tool_calling"],"description":"In final_only ACP delivery mode, text output preceding tool calls was lost because intermediate 'done' events prematurely flushed and reset the turn state, which is fixed by preserving accumulated state during partial resets."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6137,"output":101,"cacheRead":0,"cacheWrite":0,"totalTokens":6238,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534949815,"responseId":"chatcmpl-ritcz7me9vnhbs2eosbr5c"}} +{"type":"message","id":"3e24e31e","parentId":"8eb08e1a","timestamp":"2026-06-15T14:49:16.035Z","message":{"role":"toolResult","toolCallId":"632244702","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-RcbNM2/final-output.json"},"isError":false,"timestamp":1781534956035}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/prompts/20260615T144929Z-1672049.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/prompts/20260615T144929Z-1672049.md new file mode 100644 index 0000000000000000000000000000000000000000..0bedc8f35ace88d9b1b093e1015c6539de0d7bbd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/prompts/20260615T144929Z-1672049.md @@ -0,0 +1,397 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/schemas/20260615T144929Z-1672049.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/schemas/20260615T144929Z-1672049.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/schemas/20260615T144929Z-1672049.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049/2026-06-15T14-49-30-641Z_019ecbc2-5311-77bc-b086-43cb46f2dc59.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049/2026-06-15T14-49-30-641Z_019ecbc2-5311-77bc-b086-43cb46f2dc59.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..bed1158dbb8a1b70eadd32c0d470667ae2eea4ba --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88504/sessions/20260615T144929Z-1672049/2026-06-15T14-49-30-641Z_019ecbc2-5311-77bc-b086-43cb46f2dc59.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc2-5311-77bc-b086-43cb46f2dc59","timestamp":"2026-06-15T14:49:30.641Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"18ece933","parentId":null,"timestamp":"2026-06-15T14:49:30.711Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e4de8c53","parentId":"18ece933","timestamp":"2026-06-15T14:49:30.711Z","thinkingLevel":"off"} +{"type":"message","id":"60be4104","parentId":"e4de8c53","timestamp":"2026-06-15T14:49:30.715Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534970714}} +{"type":"message","id":"dd2d0105","parentId":"60be4104","timestamp":"2026-06-15T14:49:36.936Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"937394045","name":"final_json","arguments":{"caveats":["The provided GitHub context is heavily truncated, but the title and body clearly indicate a major architectural change to memory slot configuration."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical, purpose-specific memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6902,"output":96,"cacheRead":0,"cacheWrite":0,"totalTokens":6998,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534970727,"responseId":"chatcmpl-h9mswe87civmi0wmndi3dr"}} +{"type":"message","id":"5a51d15b","parentId":"dd2d0105","timestamp":"2026-06-15T14:49:36.937Z","message":{"role":"toolResult","toolCallId":"937394045","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-3u4b30/final-output.json"},"isError":false,"timestamp":1781534976937}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/prompts/20260615T144937Z-1672207.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/prompts/20260615T144937Z-1672207.md new file mode 100644 index 0000000000000000000000000000000000000000..e54e5f6fd022088881d56d022926ea4a1447a747 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/prompts/20260615T144937Z-1672207.md @@ -0,0 +1,297 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/schemas/20260615T144937Z-1672207.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/schemas/20260615T144937Z-1672207.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/schemas/20260615T144937Z-1672207.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207/2026-06-15T14-49-38-017Z_019ecbc2-6fe1-704c-a395-2e8c199f813f.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207/2026-06-15T14-49-38-017Z_019ecbc2-6fe1-704c-a395-2e8c199f813f.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..3206d2d7143806f0c072629bfb5cf3591f71a12f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-88875/sessions/20260615T144937Z-1672207/2026-06-15T14-49-38-017Z_019ecbc2-6fe1-704c-a395-2e8c199f813f.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc2-6fe1-704c-a395-2e8c199f813f","timestamp":"2026-06-15T14:49:38.017Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"23a4a65d","parentId":null,"timestamp":"2026-06-15T14:49:38.080Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"71d64333","parentId":"23a4a65d","timestamp":"2026-06-15T14:49:38.080Z","thinkingLevel":"off"} +{"type":"message","id":"63976f3a","parentId":"71d64333","timestamp":"2026-06-15T14:49:38.084Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534978083}} +{"type":"message","id":"efa7a94c","parentId":"63976f3a","timestamp":"2026-06-15T14:49:42.244Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR documents markdown and shared helpers across various components including gateway client and channel logic.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body indicate documentation updates.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5146,"output":59,"cacheRead":0,"cacheWrite":0,"totalTokens":5205,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534978099,"responseId":"chatcmpl-4tm6nx9mzbmzk7j5mdcyu"}} +{"type":"message","id":"cb8cc607","parentId":"efa7a94c","timestamp":"2026-06-15T14:49:42.991Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR documents markdown and shared helpers across various components including gateway client and channel logic.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body indicate documentation updates.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534982990}} +{"type":"message","id":"c5d06db3","parentId":"cb8cc607","timestamp":"2026-06-15T14:49:46.227Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"161630794","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body indicate documentation updates."],"topics_of_interest":["docs","gateway"],"description":"This PR documents markdown and shared helpers across various components including gateway client and channel logic."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5366,"output":69,"cacheRead":0,"cacheWrite":0,"totalTokens":5435,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534983003,"responseId":"chatcmpl-w4gg2kyekmabf51ms51y6"}} +{"type":"message","id":"d2772b09","parentId":"c5d06db3","timestamp":"2026-06-15T14:49:46.229Z","message":{"role":"toolResult","toolCallId":"161630794","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-PTUcH5/final-output.json"},"isError":false,"timestamp":1781534986229}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/prompts/20260615T144916Z-1671774.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/prompts/20260615T144916Z-1671774.md new file mode 100644 index 0000000000000000000000000000000000000000..91d8caa46a98bd579da22132b1d60db035ed9c65 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/prompts/20260615T144916Z-1671774.md @@ -0,0 +1,348 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing. This is not broad code search, but narrow source grounding is allowed +when a code-specific item is otherwise ambiguous. Return only the final +structured JSON required by the schema. No prose, markdown, analysis, or extra +fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Metadata Versus Source Evidence + +Use the GitHub context as source of truth for item metadata: target, title, +body, comments, labels, and changed files. For code semantics, a small amount +of primary repository evidence can be stronger than labels or changed-file +lists when the excerpt is truncated or ambiguous. Keep any source grounding +narrowly tied to the named behavior. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/schemas/20260615T144916Z-1671774.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/schemas/20260615T144916Z-1671774.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/schemas/20260615T144916Z-1671774.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774/2026-06-15T14-49-17-112Z_019ecbc2-1e38-72a3-8a67-2ad974043791.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774/2026-06-15T14-49-17-112Z_019ecbc2-1e38-72a3-8a67-2ad974043791.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..7dd43ca578731fceaf7ea1b02645dd4d950e061a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/source-metadata-split__openclaw-openclaw-91046/sessions/20260615T144916Z-1671774/2026-06-15T14-49-17-112Z_019ecbc2-1e38-72a3-8a67-2ad974043791.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc2-1e38-72a3-8a67-2ad974043791","timestamp":"2026-06-15T14:49:17.112Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"950d9147","parentId":null,"timestamp":"2026-06-15T14:49:17.174Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"1de3d432","parentId":"950d9147","timestamp":"2026-06-15T14:49:17.174Z","thinkingLevel":"off"} +{"type":"message","id":"38b393c5","parentId":"1de3d432","timestamp":"2026-06-15T14:49:17.178Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting. This is not broad code search, but narrow source grounding is allowed\nwhen a code-specific item is otherwise ambiguous. Return only the final\nstructured JSON required by the schema. No prose, markdown, analysis, or extra\nfields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Metadata Versus Source Evidence\n\nUse the GitHub context as source of truth for item metadata: target, title,\nbody, comments, labels, and changed files. For code semantics, a small amount\nof primary repository evidence can be stronger than labels or changed-file\nlists when the excerpt is truncated or ambiguous. Keep any source grounding\nnarrowly tied to the named behavior.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534957178}} +{"type":"message","id":"8c4f9f9a","parentId":"38b393c5","timestamp":"2026-06-15T14:49:23.186Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"980970340","name":"final_json","arguments":{"caveats":["The body mentions a fix related to provider ID matching for DeepSeek V4 thinking wrapper, which relates to agent runtime behavior when interacting with specific providers."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers from Microsoft Foundry were incorrectly routed through a DeepSeek V4 thinking wrapper due to an exact provider ID match check."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5381,"output":101,"cacheRead":0,"cacheWrite":0,"totalTokens":5482,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534957193,"responseId":"chatcmpl-th5ts17yhlm64wmo8niul"}} +{"type":"message","id":"45e63ff7","parentId":"8c4f9f9a","timestamp":"2026-06-15T14:49:23.190Z","message":{"role":"toolResult","toolCallId":"980970340","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-OXft2Q/final-output.json"},"isError":false,"timestamp":1781534963189}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/prompts/20260615T144720Z-1669400.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/prompts/20260615T144720Z-1669400.md new file mode 100644 index 0000000000000000000000000000000000000000..c7cca3a082f61252c9969c230a01520555c26092 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/prompts/20260615T144720Z-1669400.md @@ -0,0 +1,395 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/schemas/20260615T144720Z-1669400.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/schemas/20260615T144720Z-1669400.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/schemas/20260615T144720Z-1669400.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400/2026-06-15T14-47-21-082Z_019ecbc0-58fa-7177-a05a-9191448222ae.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400/2026-06-15T14-47-21-082Z_019ecbc0-58fa-7177-a05a-9191448222ae.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..37047698ba29ec67164ff1c092357d79eb31bff2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-52126/sessions/20260615T144720Z-1669400/2026-06-15T14-47-21-082Z_019ecbc0-58fa-7177-a05a-9191448222ae.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc0-58fa-7177-a05a-9191448222ae","timestamp":"2026-06-15T14:47:21.082Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"20aa5602","parentId":null,"timestamp":"2026-06-15T14:47:21.145Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"62eed3ff","parentId":"20aa5602","timestamp":"2026-06-15T14:47:21.145Z","thinkingLevel":"off"} +{"type":"message","id":"5e1ccc5d","parentId":"62eed3ff","timestamp":"2026-06-15T14:47:21.151Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534841151}} +{"type":"message","id":"bd28700c","parentId":"5e1ccc5d","timestamp":"2026-06-15T14:47:25.726Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"473596224","name":"final_json","arguments":{"caveats":["The analysis relies on the provided PR description and diff excerpts; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loopDetection to escalate repeated identical 'exec' tool calls to a critical alert level for safety."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5612,"output":86,"cacheRead":0,"cacheWrite":0,"totalTokens":5698,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534841166,"responseId":"chatcmpl-09vbf3vei1bco649eqz6rr"}} +{"type":"message","id":"9c63a9ff","parentId":"bd28700c","timestamp":"2026-06-15T14:47:25.728Z","message":{"role":"toolResult","toolCallId":"473596224","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-NLKmFT/final-output.json"},"isError":false,"timestamp":1781534845727}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/prompts/20260615T144642Z-1668877.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/prompts/20260615T144642Z-1668877.md new file mode 100644 index 0000000000000000000000000000000000000000..e053163064a4e290607501cd25ca7b457070de40 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/prompts/20260615T144642Z-1668877.md @@ -0,0 +1,446 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/schemas/20260615T144642Z-1668877.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/schemas/20260615T144642Z-1668877.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/schemas/20260615T144642Z-1668877.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877/2026-06-15T14-46-43-511Z_019ecbbf-c637-7a5f-9a9b-23b53b430075.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877/2026-06-15T14-46-43-511Z_019ecbbf-c637-7a5f-9a9b-23b53b430075.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..3c17a5972a9b2b26a770a16ca9151fa1367e3792 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-81443/sessions/20260615T144642Z-1668877/2026-06-15T14-46-43-511Z_019ecbbf-c637-7a5f-9a9b-23b53b430075.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbbf-c637-7a5f-9a9b-23b53b430075","timestamp":"2026-06-15T14:46:43.511Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"1e2ff495","parentId":null,"timestamp":"2026-06-15T14:46:43.576Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"1341e150","parentId":"1e2ff495","timestamp":"2026-06-15T14:46:43.576Z","thinkingLevel":"off"} +{"type":"message","id":"5e322ad0","parentId":"1341e150","timestamp":"2026-06-15T14:46:43.579Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534803579}} +{"type":"message","id":"f1b17e45","parentId":"5e322ad0","timestamp":"2026-06-15T14:46:50.597Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"170904055","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling."],"topics_of_interest":["model_serving","gateway"],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7324,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":7435,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534803591,"responseId":"chatcmpl-uf6moiennj8ht2s7e9ctkr"}} +{"type":"message","id":"6d69ce3c","parentId":"f1b17e45","timestamp":"2026-06-15T14:46:50.600Z","message":{"role":"toolResult","toolCallId":"170904055","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.\"\n}"}],"details":{},"isError":true,"timestamp":1781534810600}} +{"type":"message","id":"b865d7d5","parentId":"6d69ce3c","timestamp":"2026-06-15T14:46:55.745Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"732981146","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.","topics_of_interest":["model_serving","gateway"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7600,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":7711,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534810600,"responseId":"chatcmpl-rehq45lb07fkccsyk8u4qn"}} +{"type":"message","id":"6621e3ad","parentId":"b865d7d5","timestamp":"2026-06-15T14:46:55.747Z","message":{"role":"toolResult","toolCallId":"732981146","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and guarded HTTP downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling.\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.\",\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534815747}} +{"type":"message","id":"2305822f","parentId":"6621e3ad","timestamp":"2026-06-15T14:47:02.635Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe previous attempt failed due to the caveat length constraint. I need to shorten the caveat while keeping the core message and re-submit. The description and topics seem appropriate based on the evidence (guarded HTTP downloads, OpenAI-compatible responses, gateway/provider interaction)."},{"type":"toolCall","id":"258019255","name":"final_json","arguments":{"caveats":["PR covers Windows shims, image URL parsing for OpenAI providers, and guarded HTTP downloads. Classification focuses on provider routing and serving behavior."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers by routing them through a guarded HTTP path.","topics_of_interest":["model_serving","gateway"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7879,"output":149,"cacheRead":0,"cacheWrite":0,"totalTokens":8028,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534815747,"responseId":"chatcmpl-az7qzb18cmbulxx8s748d"}} +{"type":"message","id":"391ad4ad","parentId":"2305822f","timestamp":"2026-06-15T14:47:02.636Z","message":{"role":"toolResult","toolCallId":"258019255","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-hiwBfl/final-output.json"},"isError":false,"timestamp":1781534822636}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/prompts/20260615T144610Z-1668473.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/prompts/20260615T144610Z-1668473.md new file mode 100644 index 0000000000000000000000000000000000000000..a392dc25f157e66f38a11f5a4f9113e937f7dace --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/prompts/20260615T144610Z-1668473.md @@ -0,0 +1,436 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/schemas/20260615T144610Z-1668473.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/schemas/20260615T144610Z-1668473.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/schemas/20260615T144610Z-1668473.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473/2026-06-15T14-46-11-373Z_019ecbbf-48ad-73e0-8a1c-765fa6ad3a0b.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473/2026-06-15T14-46-11-373Z_019ecbbf-48ad-73e0-8a1c-765fa6ad3a0b.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..cf757a7ead472e3e2e34654b74f044424c0cce83 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-84509/sessions/20260615T144610Z-1668473/2026-06-15T14-46-11-373Z_019ecbbf-48ad-73e0-8a1c-765fa6ad3a0b.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbbf-48ad-73e0-8a1c-765fa6ad3a0b","timestamp":"2026-06-15T14:46:11.373Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"0c13b758","parentId":null,"timestamp":"2026-06-15T14:46:11.434Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e453368c","parentId":"0c13b758","timestamp":"2026-06-15T14:46:11.434Z","thinkingLevel":"off"} +{"type":"message","id":"a7be1327","parentId":"e453368c","timestamp":"2026-06-15T14:46:11.441Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534771440}} +{"type":"message","id":"f859865d","parentId":"a7be1327","timestamp":"2026-06-15T14:46:18.055Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"437289309","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6132,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":6243,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534771455,"responseId":"chatcmpl-ewseasjfnl1pwr0koupt5"}} +{"type":"message","id":"462262ab","parentId":"f859865d","timestamp":"2026-06-15T14:46:18.057Z","message":{"role":"toolResult","toolCallId":"437289309","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781534778057}} +{"type":"message","id":"df61b226","parentId":"462262ab","timestamp":"2026-06-15T14:46:23.206Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"869372314","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6408,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":6519,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534778058,"responseId":"chatcmpl-bxn812teo77vhufvunxj4"}} +{"type":"message","id":"e14cc595","parentId":"df61b226","timestamp":"2026-06-15T14:46:23.207Z","message":{"role":"toolResult","toolCallId":"869372314","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior.\"\n ],\n \"description\": \"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781534783207}} +{"type":"message","id":"7eba402d","parentId":"e14cc595","timestamp":"2026-06-15T14:46:29.806Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe previous attempt failed due to a constraint violation on the `caveats` field length. I need to shorten the caveat while keeping the core meaning and re-submit using the same classification, as it seems correct based on the evidence (ACP protocol + tool call context)."},{"type":"toolCall","id":"977693508","name":"final_json","arguments":{"caveats":["Context is PR diff fixing ACP text loss before tool calls in final_only mode."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6687,"output":144,"cacheRead":0,"cacheWrite":0,"totalTokens":6831,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534783208,"responseId":"chatcmpl-3ri0gi38bq8jzzx3oikn3"}} +{"type":"message","id":"e552abb1","parentId":"7eba402d","timestamp":"2026-06-15T14:46:29.807Z","message":{"role":"toolResult","toolCallId":"977693508","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-BH6IGH/final-output.json"},"isError":false,"timestamp":1781534789807}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/prompts/20260615T144702Z-1669099.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/prompts/20260615T144702Z-1669099.md new file mode 100644 index 0000000000000000000000000000000000000000..2c519982777bb55e0677c5cf8615d017af1033a2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/prompts/20260615T144702Z-1669099.md @@ -0,0 +1,397 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/schemas/20260615T144702Z-1669099.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/schemas/20260615T144702Z-1669099.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/schemas/20260615T144702Z-1669099.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099/2026-06-15T14-47-03-667Z_019ecbc0-14f3-7f2c-aa61-63c9c2b807a5.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099/2026-06-15T14-47-03-667Z_019ecbc0-14f3-7f2c-aa61-63c9c2b807a5.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b80ea084251b4ea2de2e29b804641f1d2539a7e4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88504/sessions/20260615T144702Z-1669099/2026-06-15T14-47-03-667Z_019ecbc0-14f3-7f2c-aa61-63c9c2b807a5.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc0-14f3-7f2c-aa61-63c9c2b807a5","timestamp":"2026-06-15T14:47:03.667Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"baef2f0f","parentId":null,"timestamp":"2026-06-15T14:47:03.734Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"33903aca","parentId":"baef2f0f","timestamp":"2026-06-15T14:47:03.735Z","thinkingLevel":"off"} +{"type":"message","id":"1a8948ab","parentId":"33903aca","timestamp":"2026-06-15T14:47:03.738Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534823738}} +{"type":"message","id":"1ef979a7","parentId":"1a8948ab","timestamp":"2026-06-15T14:47:09.812Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"102316865","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical multi-slot memory roles (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6897,"output":91,"cacheRead":0,"cacheWrite":0,"totalTokens":6988,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534823750,"responseId":"chatcmpl-yqcjkwywuraaslbcu5py"}} +{"type":"message","id":"87a65394","parentId":"1ef979a7","timestamp":"2026-06-15T14:47:09.814Z","message":{"role":"toolResult","toolCallId":"102316865","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-DjuCHx/final-output.json"},"isError":false,"timestamp":1781534829813}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/prompts/20260615T144709Z-1669221.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/prompts/20260615T144709Z-1669221.md new file mode 100644 index 0000000000000000000000000000000000000000..9ded122798f33667fe425ad6ec5c0546bd298321 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/prompts/20260615T144709Z-1669221.md @@ -0,0 +1,297 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/schemas/20260615T144709Z-1669221.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/schemas/20260615T144709Z-1669221.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/schemas/20260615T144709Z-1669221.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221/2026-06-15T14-47-10-944Z_019ecbc0-3160-7517-8f67-8fc01dc5e407.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221/2026-06-15T14-47-10-944Z_019ecbc0-3160-7517-8f67-8fc01dc5e407.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..75c6e0f33e8b7bc36c7c81093917396058296033 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-88875/sessions/20260615T144709Z-1669221/2026-06-15T14-47-10-944Z_019ecbc0-3160-7517-8f67-8fc01dc5e407.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc0-3160-7517-8f67-8fc01dc5e407","timestamp":"2026-06-15T14:47:10.944Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"92ffcdae","parentId":null,"timestamp":"2026-06-15T14:47:11.008Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"82517480","parentId":"92ffcdae","timestamp":"2026-06-15T14:47:11.008Z","thinkingLevel":"off"} +{"type":"message","id":"39645e87","parentId":"82517480","timestamp":"2026-06-15T14:47:11.012Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534831012}} +{"type":"message","id":"fa1a4d56","parentId":"39645e87","timestamp":"2026-06-15T14:47:15.568Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts with inline comments.\", \"caveats\": [\"The provided context is a pull request focused heavily on documentation updates rather than a specific functional bug or feature implementation.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5141,"output":69,"cacheRead":0,"cacheWrite":0,"totalTokens":5210,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534831028,"responseId":"chatcmpl-ro4bd7sz3oe84fie1hnov"}} +{"type":"message","id":"4c744fdb","parentId":"fa1a4d56","timestamp":"2026-06-15T14:47:16.318Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts with inline comments.\",\n \"caveats\": [\n \"The provided context is a pull request focused heavily on documentation updates rather than a specific functional bug or feature implementation.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534836317}} +{"type":"message","id":"fd15ca55","parentId":"4c744fdb","timestamp":"2026-06-15T14:47:20.009Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"132020647","name":"final_json","arguments":{"caveats":["The provided context is a pull request focused heavily on documentation updates rather than a specific functional bug or feature implementation."],"topics_of_interest":["docs","gateway"],"description":"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, and plugin SDK contracts with inline comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5381,"output":79,"cacheRead":0,"cacheWrite":0,"totalTokens":5460,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534836330,"responseId":"chatcmpl-whrxjswkq1zsfyuo5mfy"}} +{"type":"message","id":"a1183946","parentId":"fd15ca55","timestamp":"2026-06-15T14:47:20.010Z","message":{"role":"toolResult","toolCallId":"132020647","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-i9Lrnt/final-output.json"},"isError":false,"timestamp":1781534840010}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/prompts/20260615T144629Z-1668708.md b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/prompts/20260615T144629Z-1668708.md new file mode 100644 index 0000000000000000000000000000000000000000..2c3d6f61cf94e4c6307ce243e942df785658b282 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/prompts/20260615T144629Z-1668708.md @@ -0,0 +1,348 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Repository Evidence Availability + +A narrow read-only repository inspection capability may be available during +this run. It is appropriate for code-specific routing only: named files, +functions, handlers, provider predicates, delivery paths, tests, or config +keys where the supplied GitHub excerpt does not settle the maintainer bucket. +Keep any inspection to the smallest relevant lookup and ignore extra +implementation details. Do not inspect for docs-only or clearly classified +items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/schemas/20260615T144629Z-1668708.json b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/schemas/20260615T144629Z-1668708.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/schemas/20260615T144629Z-1668708.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708/2026-06-15T14-46-30-795Z_019ecbbf-948b-7071-975e-0488bedeced1.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708/2026-06-15T14-46-30-795Z_019ecbbf-948b-7071-975e-0488bedeced1.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b3447a660d0a97cf987c6b074261c1253bf62dfc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T144427Z/state/tool-aware-optional__openclaw-openclaw-91046/sessions/20260615T144629Z-1668708/2026-06-15T14-46-30-795Z_019ecbbf-948b-7071-975e-0488bedeced1.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbbf-948b-7071-975e-0488bedeced1","timestamp":"2026-06-15T14:46:30.795Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"dfb6e7fe","parentId":null,"timestamp":"2026-06-15T14:46:30.857Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"bb212613","parentId":"dfb6e7fe","timestamp":"2026-06-15T14:46:30.857Z","thinkingLevel":"off"} +{"type":"message","id":"af0bc409","parentId":"bb212613","timestamp":"2026-06-15T14:46:30.863Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Repository Evidence Availability\n\nA narrow read-only repository inspection capability may be available during\nthis run. It is appropriate for code-specific routing only: named files,\nfunctions, handlers, provider predicates, delivery paths, tests, or config\nkeys where the supplied GitHub excerpt does not settle the maintainer bucket.\nKeep any inspection to the smallest relevant lookup and ignore extra\nimplementation details. Do not inspect for docs-only or clearly classified\nitems.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781534790863}} +{"type":"message","id":"ea55116b","parentId":"af0bc409","timestamp":"2026-06-15T14:46:36.566Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"coding_agents\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the provided PR description and code changes, which focus on agent parameter handling related to specific model providers.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5376,"output":95,"cacheRead":0,"cacheWrite":0,"totalTokens":5471,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781534790877,"responseId":"chatcmpl-q3zx6knp87iu1racpuffti"}} +{"type":"message","id":"f04d1de0","parentId":"ea55116b","timestamp":"2026-06-15T14:46:37.320Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"coding_agents\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the provided PR description and code changes, which focus on agent parameter handling related to specific model providers.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781534797320}} +{"type":"message","id":"e939d78e","parentId":"f04d1de0","timestamp":"2026-06-15T14:46:42.160Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"302371823","name":"final_json","arguments":{"caveats":["The classification is based on the provided PR description and code changes, which focus on agent parameter handling related to specific model providers."],"topics_of_interest":["coding_agents","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5668,"output":105,"cacheRead":0,"cacheWrite":0,"totalTokens":5773,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781534797332,"responseId":"chatcmpl-urm469nwwmaz413gmr2qjs"}} +{"type":"message","id":"19a3f064","parentId":"e939d78e","timestamp":"2026-06-15T14:46:42.162Z","message":{"role":"toolResult","toolCallId":"302371823","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T144427Z/agent-state/structured-output/run-JNMrJJ/final-output.json"},"isError":false,"timestamp":1781534802162}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/README.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/README.md new file mode 100644 index 0000000000000000000000000000000000000000..469a171727f25aad3ac0f585b05ce995b49db09b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/README.md @@ -0,0 +1,72 @@ +# Reposhell Prompt Propensity Experiment + +Created: 2026-06-15T14:55:38.919Z + +Goal: test whether prompt wording can increase voluntary read-only repository inspection without explicitly naming or requiring the `bash` tool. + +## Setup + +- Model: `gemma-4-e4b-it` +- Target count: 6 +- Variant count: 3 +- Reposhell was exposed through the Localpager agent runtime. +- Localpager repo files were not edited; generated prompts, logs, sessions, and summaries are under this scratch experiment directory. + +## Summary + +| Variant | Runs | Sessions with bash | Successful bash sessions | Bash calls | Successful bash calls | Failures | Mean elapsed ms | +|---|---:|---:|---:|---:|---:|---:|---:| +| baseline | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 15222 | +| source-first-code-items | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 1 | 13087 | +| final-after-evidence | 6 | 0 (0.0%) | 0 (0.0%) | 0 | 0 | 0 | 16185 | + +## Variants + +### baseline + +Baseline production prompt. + +### source-first-code-items + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +### final-after-evidence + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Per-Run Results + +| Variant | Target | Status | Bash calls | Successful bash calls | Final JSON calls | Commands | +|---|---|---:|---:|---:|---:|---| +| baseline | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| baseline | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| baseline | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| source-first-code-items | openclaw/openclaw#84509 | 2 | 0 | 0 | 3 | | +| source-first-code-items | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| source-first-code-items | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| source-first-code-items | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| source-first-code-items | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| source-first-code-items | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | +| final-after-evidence | openclaw/openclaw#84509 | 0 | 0 | 0 | 3 | | +| final-after-evidence | openclaw/openclaw#91046 | 0 | 0 | 0 | 1 | | +| final-after-evidence | openclaw/openclaw#81443 | 0 | 0 | 0 | 3 | | +| final-after-evidence | openclaw/openclaw#88504 | 0 | 0 | 0 | 1 | | +| final-after-evidence | openclaw/openclaw#88875 | 0 | 0 | 0 | 1 | | +| final-after-evidence | openclaw/openclaw#52126 | 0 | 0 | 0 | 1 | | + +Full machine-readable output: `results.json`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/auth.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/auth.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/auth.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/models.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/models.json new file mode 100644 index 0000000000000000000000000000000000000000..9691cad056c66f40137e59d72ed52203186d894d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/models.json @@ -0,0 +1,31 @@ +{ + "providers": { + "local-openai": { + "baseUrl": "http://127.0.0.1:1234/v1", + "api": "openai-completions", + "apiKey": "local", + "compat": { + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "models": [ + { + "id": "gemma-4-e4b-it", + "name": "Local model (gemma-4-e4b-it)", + "reasoning": false, + "input": [ + "text" + ], + "contextWindow": 131072, + "maxTokens": 768, + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + } + } + ] + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/settings.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..87b89cc5721ad377c5b2c8ee1fd4e8bceb73d3ae --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/pi-config-runtime/settings.json @@ -0,0 +1,12 @@ +{ + "defaultProvider": "local-openai", + "defaultModel": "gemma-4-e4b-it", + "defaultThinkingLevel": "off", + "enableInstallTelemetry": false, + "quietStartup": true, + "compaction": { + "enabled": true, + "reserveTokens": 16384, + "keepRecentTokens": 20000 + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-1tn8UP/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-1tn8UP/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-1tn8UP/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-6rcZPW/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-6rcZPW/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-6rcZPW/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Cnif0Z/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Cnif0Z/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Cnif0Z/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-CpmklN/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-CpmklN/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-CpmklN/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-DyYw1g/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-DyYw1g/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-DyYw1g/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-GbjkOg/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-GbjkOg/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-GbjkOg/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-I9z0J7/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-I9z0J7/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-I9z0J7/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-L6FZNg/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-L6FZNg/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-L6FZNg/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Ojvxv6/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Ojvxv6/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Ojvxv6/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-PwMEUu/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-PwMEUu/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-PwMEUu/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Y9Qe0M/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Y9Qe0M/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-Y9Qe0M/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-aNcsc9/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-aNcsc9/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-aNcsc9/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-bu8bmz/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-bu8bmz/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-bu8bmz/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-jdUUuB/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-jdUUuB/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-jdUUuB/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-obXvWo/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-obXvWo/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-obXvWo/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-qVcIwN/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-qVcIwN/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-qVcIwN/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-rut1uo/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-rut1uo/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-rut1uo/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-xqmzD3/reposhell-bash-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-xqmzD3/reposhell-bash-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..21b323053dcb37d9e66093efde569f0abfc3c881 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/reposhell/run-xqmzD3/reposhell-bash-extension.ts @@ -0,0 +1,112 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import http from "node:http"; + +const socketPath = "/home/bob/.local/state/localpager/reposhell.sock"; +const bindPayload = {"default_repo":"openclaw","visible_repos":["openclaw"]}; +let runId: string | undefined; + +type BashParams = { command?: unknown; cmd?: unknown }; +type BindResponse = { run_id: string; cwd: string; snapshots: Record }; +type ExecResponse = { + stdout?: string; + stderr?: string; + exit_code?: number; + policy_error?: string; + truncated?: boolean; +}; + +export default function localpagerReposhellBashExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "bash", + label: "Bash", + description: "Run a read-only bash command in configured repository snapshots.", + promptSnippet: "Use bash to read repository files when needed. Commands are read-only and start in the configured default repo.", + promptGuidelines: [ + "Use bash only when repository files are needed to resolve ambiguity.", + "Prefer rg, find, sed -n, cat, head, and git grep for concise inspection.", + "Do not attempt write, network, package-manager, interpreter, pipeline, or redirect commands." + ], + parameters: { + type: "object", + additionalProperties: false, + required: ["command"], + properties: { + command: { type: "string", description: "Read-only bash-shaped command to run." } + } + }, + async execute(_toolCallId: string, params: unknown) { + const command = readCommand(params); + if (runId === undefined) { + const binding = await postJSON("/bind", bindPayload); + runId = binding.run_id; + } + const result = await postJSON("/exec", { run_id: runId, command }); + return { + content: [{ type: "text", text: formatResult(result) }], + details: result + }; + } + }); +} + +function readCommand(params: unknown): string { + if (typeof params !== "object" || params === null) { + throw new Error("bash params must be an object"); + } + const command = (params as BashParams).command; + if (typeof command !== "string" || command.trim().length === 0) { + throw new Error("bash.command must be a non-empty string"); + } + return command; +} + +function postJSON(path: string, payload: unknown): Promise { + return new Promise((resolve, reject) => { + const body = JSON.stringify(payload); + const req = http.request( + { + socketPath, + path, + method: "POST", + headers: { + "content-type": "application/json", + "content-length": Buffer.byteLength(body) + } + }, + (res) => { + const chunks: Buffer[] = []; + res.on("data", (chunk: Buffer) => chunks.push(chunk)); + res.on("end", () => { + const raw = Buffer.concat(chunks).toString("utf8"); + if ((res.statusCode ?? 500) < 200 || (res.statusCode ?? 500) >= 300) { + reject(new Error(`reposhell ${path} failed: ${raw}`)); + return; + } + resolve(JSON.parse(raw) as T); + }); + } + ); + req.on("error", reject); + req.end(body); + }); +} + +function formatResult(result: ExecResponse): string { + const parts: string[] = []; + if (result.stdout !== undefined && result.stdout.length > 0) { + parts.push(result.stdout); + } + if (result.stderr !== undefined && result.stderr.length > 0) { + parts.push(`stderr:\n${result.stderr}`); + } + if (result.policy_error !== undefined && result.policy_error.length > 0) { + parts.push(`policy_error: ${result.policy_error}`); + } + if (result.exit_code !== undefined && result.exit_code !== 0) { + parts.push(`exit_code: ${result.exit_code}`); + } + if (result.truncated === true) { + parts.push("truncated: true"); + } + return parts.length === 0 ? "exit_code: 0" : parts.join("\n"); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-1TZpQP/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-1TZpQP/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-1TZpQP/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-2R81Pp/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-2R81Pp/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-2R81Pp/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-8mkOXy/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-8mkOXy/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-8mkOXy/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-ArcR5i/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-ArcR5i/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-ArcR5i/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-BIPoC9/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-BIPoC9/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-BIPoC9/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-CS4Dse/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-CS4Dse/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-CS4Dse/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-KzvQ6N/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-KzvQ6N/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-KzvQ6N/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-NVfzh7/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-NVfzh7/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-NVfzh7/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-UjfvEr/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-UjfvEr/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-UjfvEr/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-VTchJc/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-VTchJc/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-VTchJc/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-b7YNf9/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-b7YNf9/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-b7YNf9/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-bDbPzB/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-bDbPzB/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-bDbPzB/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-e9Ph4j/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-e9Ph4j/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-e9Ph4j/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-fT87ER/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-fT87ER/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-fT87ER/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-oySxPw/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-oySxPw/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-oySxPw/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-pOzMzI/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-pOzMzI/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-pOzMzI/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-qOyRtu/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-qOyRtu/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-qOyRtu/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-wEXdHQ/request-params-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-wEXdHQ/request-params-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b49b39a878e3278ffb60d8b3bf7286d89f51c17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/request-params/run-wEXdHQ/request-params-extension.ts @@ -0,0 +1,20 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +const requestParams = { + "temperature": 0, + "top_p": 1, + "max_tokens": 768 +} as const; + +export default function localpagerAgentRequestParamsExtension(pi: ExtensionAPI): void { + pi.on("before_provider_request", (event) => { + if (!isRecord(event.payload)) { + return event.payload; + } + return { ...event.payload, ...requestParams }; + }); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..55ff41f15e836b77a1cdcde42b75847c02277378 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..b240d15c61c3f915f7a205f22afe6ed46bd6530a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..a18cfeabf8571f2121ab5c69b0c1a3649e79ad2a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..2dd429c7de7757b7eeb2905a42247d7df3a200fb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-output.json @@ -0,0 +1,11 @@ +{ + "caveats": [ + "This PR addresses multiple functional areas, including Windows shims (QMD/memory), image URL parsing for providers (model_serving), and guarded HTTP routing (gateway)." + ], + "description": "This PR resolves issues with Windows QMD shims and implements guarded HTTP downloads for provider-returned image URLs.", + "topics_of_interest": [ + "model_serving", + "gateway", + "memory" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..20a66363e11eff5df088ea712500ee8c9fed4927 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc2d148cb50454e5eee34848c3fedaede823433b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..74d3ffb1d4e7a924783d00f5aee88c707b45e21d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..4776f0067f1e9345cd3aecb5fde07b2110a1cf7b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..164567fabf7c7a5daa1a7077f1de0e9692b7cdcb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..2879bb1bfd373d0ed4de3df8c135fc804b33c23f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-output.json @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation work." + ], + "topics_of_interest": [ + "docs" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, CLI, and other contracts with JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfce15a93f83a48f38fb50cd2d5cc2e896ad46ee --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..e62fd4334b05adbe6aeaf811a811b30ccae4c409 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6357d8849ad3adb8eb968c669eb23c7c4cd2ee0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..6b4baa2ec9e1be25cfcca19a70bbb1dbd71ea888 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context is a PR fixing text loss in final_only ACP delivery mode during multi-step agentic turns." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..c946f12612cd7142f4bd3783baeab94b2acb07c1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..a76d38d9dd65376c9fde01f957d0d0a7d8d1bcee --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..bd9c4ac7407a8bd728ada23ce68b7e979bd0a8e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "PR fixes Windows QMD shims and guards external image URL downloads from OpenAI-compatible providers via guarded HTTP transport." + ], + "description": "This PR resolves issues with Windows QMD shims and implements guarded download paths for image URLs returned by OpenAI-compatible providers.", + "topics_of_interest": [ + "model_serving", + "gateway" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9422a255b678b2f33968005d509039fa22e0756 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..c62517a0b4b95df33b3efcfd7a4197a0fdd3c771 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model providers." + ], + "topics_of_interest": [ + "coding_agents", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bb9a36a6304b1495bda57b47d3049663395db6d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..d168d903edb6f96f0c495b27167f58b7005d1f37 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff snippets; full context might be unavailable." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loop detection to escalate repeated identical 'exec' tool calls to a critical alert level." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..602d077f0d764d419702e2b11a47b8438dbc2cf3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..cf39acac21ca93e01de2c50f8555c92994422265 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The PR addresses a specific provider routing issue related to DeepSeek V4 thinking wrapper compatibility with Microsoft Foundry alias providers." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an agent runtime bug where alias providers for microsoft-foundry incorrectly triggered the DeepSeek V4 thinking wrapper due to an exact provider ID match instead of a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mZB2Id/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mZB2Id/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..b45135ab21720128ff58c936c6daeb280d208223 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mZB2Id/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mZB2Id/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e259bdebd94b27549f99ae1397e88b201d52f4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..191b522e83478801c2ca30033f9b3391552e8a17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a large PR description and diff, but the core change revolves around memory slot architecture updates. The classification relies heavily on the title and body summary regarding memory roles." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces a multi-slot memory role architecture to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-json-extension.ts b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-json-extension.ts new file mode 100644 index 0000000000000000000000000000000000000000..62bbf216f5646032f60a01673a83eb0e65ec45d0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-json-extension.ts @@ -0,0 +1,102 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { writeFileSync } from "node:fs"; + +const schema = { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} as const; +const outputPath = "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-output.json"; + +export default function localpagerAgentFinalJsonExtension(pi: ExtensionAPI): void { + pi.registerTool({ + name: "final_json", + label: "Final JSON", + description: "Submit the final structured answer and end the run.", + promptSnippet: "Use final_json to submit the final structured answer. Call it exactly once after completing the requested work.", + promptGuidelines: [ + "Complete any required investigation first.", + "When done, call final_json with the final answer.", + "Do not write the final answer as ordinary prose." + ], + parameters: schema, + async execute(_toolCallId: string, params: unknown) { + writeFileSync(outputPath, JSON.stringify(params, null, 2) + "\n", "utf8"); + return { + content: [{ type: "text", text: "Structured final answer captured." }], + details: { outputPath }, + terminate: true + }; + } + }); +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-output.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-output.json new file mode 100644 index 0000000000000000000000000000000000000000..d8dc44379a5913dce7a4b9705c047e567902adbd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-output.json @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the PR title and body content, which focuses on loop detection for 'exec' tool calls. The full context of how this relates to broader OpenClaw functionality is not available." + ], + "topics_of_interest": [ + "tool_calling", + "exec_tools" + ], + "description": "This pull request enhances loop detection by escalating repeated identical 'exec' tool calls to a critical alert level." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-52126.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-52126.md new file mode 100644 index 0000000000000000000000000000000000000000..be82df8a4351d2b4acfe88676c058f3073716dc6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-52126.md @@ -0,0 +1,168 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-81443.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-81443.md new file mode 100644 index 0000000000000000000000000000000000000000..7b178accfcec455ab65201d98961ef0470f78992 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-81443.md @@ -0,0 +1,219 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-84509.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-84509.md new file mode 100644 index 0000000000000000000000000000000000000000..0223bcacf512af850ab96d12f6c8f91e7137bfdb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-84509.md @@ -0,0 +1,209 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88504.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88504.md new file mode 100644 index 0000000000000000000000000000000000000000..4ac10500b86ec809387c59d86e7e407f694f37e4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88504.md @@ -0,0 +1,170 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88875.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88875.md new file mode 100644 index 0000000000000000000000000000000000000000..83adcfc7633c6424cf576a6788f9bae1438680be --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-88875.md @@ -0,0 +1,70 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-91046.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-91046.md new file mode 100644 index 0000000000000000000000000000000000000000..b03d107469f70f1647247a41a4adc60c58d42c99 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/contexts/openclaw-openclaw-91046.md @@ -0,0 +1,121 @@ +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..d8c1c461c81ec694eb6397c27f1d68fb58f8a886 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T145237Z-1677753.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T145237Z-1677753.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1b255efe92e6c1a8f1d80b0fdfd8df3874446ba9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..53d523866019ffd1960451a067c007767037146e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T145142Z-1676309.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T145142Z-1676309.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..0b39e249c78873b61bd76317d34cb7813092c1e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport." + ], + "description": "This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.", + "topics_of_interest": [ + "model_serving" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..bb1b9d352a3bc78b015fa9018a187db870c4b250 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T145111Z-1675869.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T145111Z-1675869.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..71dec33bb77582e52b29de1979f6cd160a8fe900 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use." + ], + "topics_of_interest": [ + "acp", + "tool_calling" + ], + "description": "This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..171f8f4345fe68aa19d18e0d7cc60aa11e2d65a6 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T145221Z-1677481.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T145221Z-1677481.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..47a32419ee81d822cbad9e77af8a4a427de86f87 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T145226Z-1677597.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T145226Z-1677597.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..1e4410e1f7baa2db6d02142ed14a2b6bde048145 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..5da18e4d3b9359c9531bf17ca636ac0b142c792e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T145130Z-1676119.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T145130Z-1676119.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..ae91cf1c561054874782ba5f97a8a73ad41a6322 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..39ceceb4f856bcda1e4542079a92600b61a0bcca --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/prompts/20260615T145532Z-1679974.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/schemas/20260615T145532Z-1679974.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..d8dc44379a5913dce7a4b9705c047e567902adbd --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the PR title and body content, which focuses on loop detection for 'exec' tool calls. The full context of how this relates to broader OpenClaw functionality is not available." + ], + "topics_of_interest": [ + "tool_calling", + "exec_tools" + ], + "description": "This pull request enhances loop detection by escalating repeated identical 'exec' tool calls to a critical alert level." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..0d6c46a7cee7a4178f556a452c0a38418aaea2f1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/prompts/20260615T145428Z-1679287.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/schemas/20260615T145428Z-1679287.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..2dd429c7de7757b7eeb2905a42247d7df3a200fb --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,11 @@ +{ + "caveats": [ + "This PR addresses multiple functional areas, including Windows shims (QMD/memory), image URL parsing for providers (model_serving), and guarded HTTP routing (gateway)." + ], + "description": "This PR resolves issues with Windows QMD shims and implements guarded HTTP downloads for provider-returned image URLs.", + "topics_of_interest": [ + "model_serving", + "gateway", + "memory" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..3ef9f31cf7dcbc95440c5bce9fed89f8958843da --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/prompts/20260615T145401Z-1678919.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/schemas/20260615T145401Z-1678919.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..6b4baa2ec9e1be25cfcca19a70bbb1dbd71ea888 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "Context is a PR fixing text loss in final_only ACP delivery mode during multi-step agentic turns." + ], + "description": "This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.", + "topics_of_interest": [ + "acp", + "tool_calling" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..78cc42715c5f01d34e9627dd61018e35efea2eda --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/prompts/20260615T145514Z-1679691.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/schemas/20260615T145514Z-1679691.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..191b522e83478801c2ca30033f9b3391552e8a17 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is a large PR description and diff, but the core change revolves around memory slot architecture updates. The classification relies heavily on the title and body summary regarding memory roles." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces a multi-slot memory role architecture to allow memory plugins to compose instead of replacing each other via a single global selector." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..2ac6148696ebe83522b897391d0f99a35322cd8c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/prompts/20260615T145521Z-1679814.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/schemas/20260615T145521Z-1679814.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..4776f0067f1e9345cd3aecb5fde07b2110a1cf7b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems." + ], + "topics_of_interest": [ + "docs", + "gateway" + ], + "description": "This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..e6a60edaa83f777e4ea07146c9750f8742e55b60 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/prompts/20260615T145421Z-1679174.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/schemas/20260615T145421Z-1679174.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..cf39acac21ca93e01de2c50f8555c92994422265 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The PR addresses a specific provider routing issue related to DeepSeek V4 thinking wrapper compatibility with Microsoft Foundry alias providers." + ], + "topics_of_interest": [ + "agent_runtime", + "local_model_providers" + ], + "description": "This PR fixes an agent runtime bug where alias providers for microsoft-foundry incorrectly triggered the DeepSeek V4 thinking wrapper due to an exact provider ID match instead of a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..67693bf7844f1816304c6010422383ac2a6a1324 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/prompts/20260615T145356Z-1678809.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/schemas/20260615T145356Z-1678809.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..d168d903edb6f96f0c495b27167f58b7005d1f37 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The analysis relies on the provided PR description and diff snippets; full context might be unavailable." + ], + "topics_of_interest": [ + "exec_tools", + "tool_calling" + ], + "description": "This PR extends loop detection to escalate repeated identical 'exec' tool calls to a critical alert level." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..40c4147c61fdbb962a205918332ff68707346e59 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/prompts/20260615T145318Z-1678298.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/schemas/20260615T145318Z-1678298.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..bd9c4ac7407a8bd728ada23ce68b7e979bd0a8e1 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "PR fixes Windows QMD shims and guards external image URL downloads from OpenAI-compatible providers via guarded HTTP transport." + ], + "description": "This PR resolves issues with Windows QMD shims and implements guarded download paths for image URLs returned by OpenAI-compatible providers.", + "topics_of_interest": [ + "model_serving", + "gateway" + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..47b0023cca7cc3fde6681ba8d598f485d5b36a21 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stderr.log @@ -0,0 +1,4 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/prompts/20260615T145243Z-1677863.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/schemas/20260615T145243Z-1677863.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863 +localpager-agent: final_json was not called; no structured output was captured diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..143990b6d1c9d82c0c3f45c0b224a0b975a3e275 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/prompts/20260615T145338Z-1678531.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/schemas/20260615T145338Z-1678531.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..f2860b42ac85767c9a550d662fb79e8caff6cfb3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture." + ], + "topics_of_interest": [ + "memory", + "config" + ], + "description": "This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..e897e79e6f6d34690f828eef912b1f414fc83a1a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/prompts/20260615T145346Z-1678652.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/schemas/20260615T145346Z-1678652.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..2879bb1bfd373d0ed4de3df8c135fc804b33c23f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stdout.log @@ -0,0 +1,9 @@ +{ + "caveats": [ + "The full context of the changes is truncated, but the title and body clearly indicate documentation work." + ], + "topics_of_interest": [ + "docs" + ], + "description": "This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, CLI, and other contracts with JSDoc and inline invariant comments." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stderr.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..cdc218944608aa09ae03398eb1baae32b9d1457b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stderr.log @@ -0,0 +1,3 @@ +prompt: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/prompts/20260615T145305Z-1678122.md +schema: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/schemas/20260615T145305Z-1678122.json +session: /home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122 diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stdout.log b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..c62517a0b4b95df33b3efcfd7a4197a0fdd3c771 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stdout.log @@ -0,0 +1,10 @@ +{ + "caveats": [ + "The classification is based on the title and body, which detail changes in agent parameter handling related to specific model providers." + ], + "topics_of_interest": [ + "coding_agents", + "local_model_providers" + ], + "description": "This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match." +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/baseline.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/baseline.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..b5a47399be1f9bb46bb0ec18800b51bbafdf1132 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/baseline.prompt.md @@ -0,0 +1,138 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/final-after-evidence.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/final-after-evidence.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..a0a72b3058f09954a46ab2777dcc0d34f24dd63c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/final-after-evidence.prompt.md @@ -0,0 +1,145 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/source-first-code-items.prompt.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/source-first-code-items.prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..ad340aac30f07919f873a9899729c4a01b6e983f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/source-first-code-items.prompt.md @@ -0,0 +1,147 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +__ALLOWED_TOPICS_JSON__ +``` + +Topic definitions and cue words: + +__TOPIC_DESCRIPTIONS__ + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`__TARGET__` + +## GitHub Context + +__GITHUB_CONTEXT__ + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/results.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/results.json new file mode 100644 index 0000000000000000000000000000000000000000..5aa82a7193603dc239fbb20472417ce8c790e1e2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/results.json @@ -0,0 +1,490 @@ +{ + "created_at": "2026-06-15T14:55:38.919Z", + "out_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z", + "localpager_root": "/home/bob/repos/localpager", + "model": "gemma-4-e4b-it", + "targets": [ + "openclaw/openclaw#84509", + "openclaw/openclaw#91046", + "openclaw/openclaw#81443", + "openclaw/openclaw#88504", + "openclaw/openclaw#88875", + "openclaw/openclaw#52126" + ], + "variants": [ + { + "name": "baseline", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/baseline.prompt.md", + "inserted_text": "" + }, + { + "name": "source-first-code-items", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/source-first-code-items.prompt.md", + "inserted_text": "## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n" + }, + { + "name": "final-after-evidence", + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/prompts/final-after-evidence.prompt.md", + "inserted_text": "## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n" + } + ], + "by_variant": [ + { + "variant": "baseline", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 15222 + }, + { + "variant": "source-first-code-items", + "runs": 6, + "failures": 1, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 13086.833333333334 + }, + { + "variant": "final-after-evidence", + "runs": 6, + "failures": 0, + "sessions_with_bash": 0, + "bash_session_rate": 0, + "sessions_with_successful_bash": 0, + "successful_bash_session_rate": 0, + "bash_calls": 0, + "successful_bash_calls": 0, + "final_json_calls": 10, + "mean_elapsed_ms": 16185 + } + ], + "results": [ + { + "id": "baseline__openclaw-openclaw-84509", + "variant": "baseline", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 18373, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T145111Z-1675869.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T145111Z-1675869.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-13-152Z_019ecbc3-e380-7c96-bfdd-1b306bc3982a.jsonl", + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-26-090Z_019ecbc4-160a-7d7e-b0c5-b72667e57e9d.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-91046", + "variant": "baseline", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12453, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T145130Z-1676119.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T145130Z-1676119.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119/2026-06-15T14-51-31-296Z_019ecbc4-2a60-7271-952d-a698249a7edb.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-81443", + "variant": "baseline", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 38527, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T145142Z-1676309.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T145142Z-1676309.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309/2026-06-15T14-51-44-028Z_019ecbc4-5c1c-7645-98d9-735acb5ce264.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88504", + "variant": "baseline", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 5510, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T145221Z-1677481.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T145221Z-1677481.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481/2026-06-15T14-52-22-368Z_019ecbc4-f1e0-71f1-aab8-e220660d3a3f.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-88875", + "variant": "baseline", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10634, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T145226Z-1677597.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T145226Z-1677597.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597/2026-06-15T14-52-27-815Z_019ecbc5-0727-796b-bc33-e87c1459dbd4.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "baseline__openclaw-openclaw-52126", + "variant": "baseline", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5835, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T145237Z-1677753.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T145237Z-1677753.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/baseline__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753/2026-06-15T14-52-38-369Z_019ecbc5-3061-7575-863c-3f5305a4aba2.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-84509", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#84509", + "status": 2, + "elapsed_ms": 22641, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/prompts/20260615T145243Z-1677863.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/schemas/20260615T145243Z-1677863.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-52-44-283Z_019ecbc5-477b-7737-9be7-0d693932cbbf.jsonl", + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-53-02-686Z_019ecbc5-8f5e-75dd-a5af-9c27456a9498.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-91046", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 12295, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/prompts/20260615T145305Z-1678122.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/schemas/20260615T145305Z-1678122.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122/2026-06-15T14-53-06-903Z_019ecbc5-9fd7-7f50-b667-6e6cd1c60dcf.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-81443", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 20670, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/prompts/20260615T145318Z-1678298.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/schemas/20260615T145318Z-1678298.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298/2026-06-15T14-53-19-223Z_019ecbc5-cff7-7587-81c7-cbffe0dba95e.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-88504", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7230, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/prompts/20260615T145338Z-1678531.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/schemas/20260615T145338Z-1678531.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531/2026-06-15T14-53-39-873Z_019ecbc6-20a1-78da-b323-bf0165daef18.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-88875", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 10353, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/prompts/20260615T145346Z-1678652.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/schemas/20260615T145346Z-1678652.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652/2026-06-15T14-53-47-171Z_019ecbc6-3d23-756b-af7a-62331b12490f.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "source-first-code-items__openclaw-openclaw-52126", + "variant": "source-first-code-items", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 5332, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/prompts/20260615T145356Z-1678809.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/schemas/20260615T145356Z-1678809.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/source-first-code-items__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809/2026-06-15T14-53-57-491Z_019ecbc6-6573-7be1-b466-9c2cbe76f266.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-84509", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#84509", + "status": 0, + "elapsed_ms": 19968, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/prompts/20260615T145401Z-1678919.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/schemas/20260615T145401Z-1678919.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-84509.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919/2026-06-15T14-54-02-814Z_019ecbc6-7a3e-7bcf-85a6-9bf5404a7d7a.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-91046", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#91046", + "status": 0, + "elapsed_ms": 7111, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/prompts/20260615T145421Z-1679174.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/schemas/20260615T145421Z-1679174.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-91046.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174/2026-06-15T14-54-22-749Z_019ecbc6-c81d-725e-98c0-58aac5ff2af4.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-81443", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#81443", + "status": 0, + "elapsed_ms": 45269, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/prompts/20260615T145428Z-1679287.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/schemas/20260615T145428Z-1679287.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-81443.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287/2026-06-15T14-54-30-106Z_019ecbc6-e4da-73d3-935c-f35fadd467fa.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 3, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-88504", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#88504", + "status": 0, + "elapsed_ms": 7426, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/prompts/20260615T145514Z-1679691.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/schemas/20260615T145514Z-1679691.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88504.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691/2026-06-15T14-55-15-145Z_019ecbc7-94c9-7e48-ac23-b99d2b44f643.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-88875", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#88875", + "status": 0, + "elapsed_ms": 11019, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/prompts/20260615T145521Z-1679814.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/schemas/20260615T145521Z-1679814.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-88875.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814/2026-06-15T14-55-22-746Z_019ecbc7-b27a-7f99-9755-dc3424f9b6e9.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + }, + { + "id": "final-after-evidence__openclaw-openclaw-52126", + "variant": "final-after-evidence", + "target": "openclaw/openclaw#52126", + "status": 0, + "elapsed_ms": 6317, + "prompt_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/prompts/20260615T145532Z-1679974.md", + "schema_path": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/schemas/20260615T145532Z-1679974.json", + "stdout_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stdout.log", + "stderr_log": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/logs/final-after-evidence__openclaw-openclaw-52126.stderr.log", + "session_dir": "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974", + "session_files": [ + "/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974/2026-06-15T14-55-33-569Z_019ecbc7-dcc1-7e1d-be6e-67fb0b36c309.jsonl" + ], + "bash_calls": 0, + "successful_bash_calls": 0, + "failed_bash_calls": 0, + "final_json_calls": 1, + "models": [ + "gemma-4-e4b-it" + ], + "commands": [] + } + ] +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T145237Z-1677753.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T145237Z-1677753.md new file mode 100644 index 0000000000000000000000000000000000000000..9913d2f4cdd5a722dca91f7cc4c8d3407b321905 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/prompts/20260615T145237Z-1677753.md @@ -0,0 +1,385 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T145237Z-1677753.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T145237Z-1677753.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/schemas/20260615T145237Z-1677753.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753/2026-06-15T14-52-38-369Z_019ecbc5-3061-7575-863c-3f5305a4aba2.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753/2026-06-15T14-52-38-369Z_019ecbc5-3061-7575-863c-3f5305a4aba2.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..39993b9ebbdac6f8a343a56a6b285f0d147d55f3 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-52126/sessions/20260615T145237Z-1677753/2026-06-15T14-52-38-369Z_019ecbc5-3061-7575-863c-3f5305a4aba2.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc5-3061-7575-863c-3f5305a4aba2","timestamp":"2026-06-15T14:52:38.369Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"9f06add0","parentId":null,"timestamp":"2026-06-15T14:52:38.433Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ac570aa1","parentId":"9f06add0","timestamp":"2026-06-15T14:52:38.433Z","thinkingLevel":"off"} +{"type":"message","id":"cb73d9c9","parentId":"ac570aa1","timestamp":"2026-06-15T14:52:38.437Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535158437}} +{"type":"message","id":"6826b830","parentId":"cb73d9c9","timestamp":"2026-06-15T14:52:43.144Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"681785843","name":"final_json","arguments":{"caveats":["The analysis relies on the provided diffs and PR description; full context regarding all tool types and loop detection logic was not available."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loopDetection to escalate repeated identical exec tool calls to critical alerts, specifically addressing risks associated with dangerous execution tools."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5518,"output":89,"cacheRead":0,"cacheWrite":0,"totalTokens":5607,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535158454,"responseId":"chatcmpl-7jl5zzgp8vj8dzykyhf7b"}} +{"type":"message","id":"cc903c6e","parentId":"6826b830","timestamp":"2026-06-15T14:52:43.146Z","message":{"role":"toolResult","toolCallId":"681785843","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-PbodLZ/final-output.json"},"isError":false,"timestamp":1781535163145}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T145142Z-1676309.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T145142Z-1676309.md new file mode 100644 index 0000000000000000000000000000000000000000..b3c6370238748f539d5e7fc6c020a583aa726e64 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/prompts/20260615T145142Z-1676309.md @@ -0,0 +1,436 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T145142Z-1676309.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T145142Z-1676309.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/schemas/20260615T145142Z-1676309.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309/2026-06-15T14-51-44-028Z_019ecbc4-5c1c-7645-98d9-735acb5ce264.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309/2026-06-15T14-51-44-028Z_019ecbc4-5c1c-7645-98d9-735acb5ce264.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f4b66ef92fa7fc73a720b2dd4b2b6e7e7afbe89d --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-81443/sessions/20260615T145142Z-1676309/2026-06-15T14-51-44-028Z_019ecbc4-5c1c-7645-98d9-735acb5ce264.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbc4-5c1c-7645-98d9-735acb5ce264","timestamp":"2026-06-15T14:51:44.028Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"1934c21c","parentId":null,"timestamp":"2026-06-15T14:51:44.094Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"a9246570","parentId":"1934c21c","timestamp":"2026-06-15T14:51:44.094Z","thinkingLevel":"off"} +{"type":"message","id":"543eaa7b","parentId":"a9246570","timestamp":"2026-06-15T14:51:44.098Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535104097}} +{"type":"message","id":"625f0754","parentId":"543eaa7b","timestamp":"2026-06-15T14:51:50.863Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"852607729","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"topics_of_interest":["model_serving","gateway"],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7230,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":7336,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535104109,"responseId":"chatcmpl-f99r45qc9grekkhocl64"}} +{"type":"message","id":"f100b6d2","parentId":"625f0754","timestamp":"2026-06-15T14:51:50.866Z","message":{"role":"toolResult","toolCallId":"852607729","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\"\n}"}],"details":{},"isError":true,"timestamp":1781535110866}} +{"type":"message","id":"96c5e7f8","parentId":"f100b6d2","timestamp":"2026-06-15T14:51:55.589Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"543239696","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7496,"output":102,"cacheRead":0,"cacheWrite":0,"totalTokens":7598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535110866,"responseId":"chatcmpl-iu48c4ox27m4sqgp7hytp"}} +{"type":"message","id":"8ecaee0b","parentId":"96c5e7f8","timestamp":"2026-06-15T14:51:55.590Z","message":{"role":"toolResult","toolCallId":"543239696","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider timeouts, but the primary focus related to routing/provider interaction is on guarded HTTP downloads of URLs returned by providers.\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.\",\n \"topics_of_interest\": [\n \"model_serving\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535115590}} +{"type":"message","id":"bd622a17","parentId":"8ecaee0b","timestamp":"2026-06-15T14:52:21.248Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe user wants me to classify a GitHub PR based on its title and body, routing it for maintainer notification.\nThe required output is a specific JSON structure.\n\nTitle: `fix: resolve QMD Windows shims and guard image URL downloads`\nLabels include: `docs`, `gateway`, `extensions: memory-core`, `agents`, etc.\nBody mentions:\n1. \"Resolve Windows `.cmd` shims...\" (OS/shim issue)\n2. \"Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\" (API parsing, related to model output handling)\n3. \"Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\" (This is key: routing/downloading from a provider URL).\n\nTopics analysis:\n- `model_serving`: Cues include \"streaming behavior, **routing**, lifecycle, and gateway behavi... cues: vllm\". The body explicitly mentions \"Route provider-returned image URLs through guarded HTTP...\" which strongly aligns with serving/routing behavior.\n- `gateway`: Mentioned in labels, and the PR touches on aspects related to how requests flow (though the core fix is about URL handling *after* a response).\n- `local_model_providers`: Not central; it's about handling URLs from providers, not setting up provider configuration/auth.\n\nThe most central theme for routing seems to be the secure handling and routing of external image URLs returned by an OpenAI-compatible provider, which falls under `model_serving`. The mention of \"gateway\" in labels is secondary to the functional fix described in the body regarding URL transport.\n\nI will select `model_serving` as the primary topic. I will keep the description concise and evidence-backed.\n\nRevisiting the previous attempt:\nThe first attempt used `[\"model_serving\", \"gateway\"]`. The second attempt used only `[\"model_serving\"]`. Given the strong focus on URL routing/downloading from a provider response, `model_serving` is sufficient and adheres to the rule of choosing the smallest set.\n\nI will use the refined single-topic classification."},{"type":"toolCall","id":"945999446","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims and QMD path resolution, but the core functional change relevant for routing maintenance is guarding provider-returned image URLs via HTTP transport."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a bounded HTTP path.","topics_of_interest":["model_serving"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7756,"output":567,"cacheRead":0,"cacheWrite":0,"totalTokens":8323,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535115590,"responseId":"chatcmpl-hz1vc48ocntr6lqrod99m"}} +{"type":"message","id":"014b26f4","parentId":"bd622a17","timestamp":"2026-06-15T14:52:21.249Z","message":{"role":"toolResult","toolCallId":"945999446","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-4Vit9v/final-output.json"},"isError":false,"timestamp":1781535141249}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T145111Z-1675869.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T145111Z-1675869.md new file mode 100644 index 0000000000000000000000000000000000000000..181e17dac120c53b9cf4839a86ea6ea616b3ba29 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/prompts/20260615T145111Z-1675869.md @@ -0,0 +1,426 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T145111Z-1675869.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T145111Z-1675869.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/schemas/20260615T145111Z-1675869.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-13-152Z_019ecbc3-e380-7c96-bfdd-1b306bc3982a.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-13-152Z_019ecbc3-e380-7c96-bfdd-1b306bc3982a.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..8a9231d1517d41a3749e423f360c33fc13a3e37c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-13-152Z_019ecbc3-e380-7c96-bfdd-1b306bc3982a.jsonl @@ -0,0 +1,9 @@ +{"type":"session","version":3,"id":"019ecbc3-e380-7c96-bfdd-1b306bc3982a","timestamp":"2026-06-15T14:51:13.152Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"1e020dc4","parentId":null,"timestamp":"2026-06-15T14:51:13.217Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"8b215e57","parentId":"1e020dc4","timestamp":"2026-06-15T14:51:13.217Z","thinkingLevel":"off"} +{"type":"message","id":"c00ada31","parentId":"8b215e57","timestamp":"2026-06-15T14:51:13.224Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535073223}} +{"type":"message","id":"61442079","parentId":"c00ada31","timestamp":"2026-06-15T14:51:20.240Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"600750230","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6038,"output":118,"cacheRead":0,"cacheWrite":0,"totalTokens":6156,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535073236,"responseId":"chatcmpl-63t6igridsdsm2sahifw4"}} +{"type":"message","id":"672a31b2","parentId":"61442079","timestamp":"2026-06-15T14:51:20.242Z","message":{"role":"toolResult","toolCallId":"600750230","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781535080242}} +{"type":"message","id":"a7b667ff","parentId":"672a31b2","timestamp":"2026-06-15T14:51:25.123Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"256873351","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body."],"description":"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6328,"output":106,"cacheRead":0,"cacheWrite":0,"totalTokens":6434,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535080243,"responseId":"chatcmpl-gpe9pvfbblrx65c2gzxk9"}} +{"type":"message","id":"2b96e7fd","parentId":"a7b667ff","timestamp":"2026-06-15T14:51:25.124Z","message":{"role":"toolResult","toolCallId":"256873351","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling, specifically concerning text preservation during tool calls in 'final_only' delivery mode. The classification relies heavily on the cue words present in the title and body.\"\n ],\n \"description\": \"This change preserves pre-tool text output when using final_only delivery mode within ACP turns that involve tool calls.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535085124}} +{"type":"message","id":"c4a949db","parentId":"2b96e7fd","timestamp":"2026-06-15T14:51:25.340Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6597,"output":1,"cacheRead":0,"cacheWrite":0,"totalTokens":6598,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535085124,"responseId":"chatcmpl-d48c0mkkskqq4i94ecxop"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-26-090Z_019ecbc4-160a-7d7e-b0c5-b72667e57e9d.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-26-090Z_019ecbc4-160a-7d7e-b0c5-b72667e57e9d.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..89cc4c1e51a5696f2ca7ad8e54ad4e04357bcd03 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-84509/sessions/20260615T145111Z-1675869/2026-06-15T14-51-26-090Z_019ecbc4-160a-7d7e-b0c5-b72667e57e9d.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc4-160a-7d7e-b0c5-b72667e57e9d","timestamp":"2026-06-15T14:51:26.090Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"0fb95dc4","parentId":null,"timestamp":"2026-06-15T14:51:26.109Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"8de58fab","parentId":"0fb95dc4","timestamp":"2026-06-15T14:51:26.109Z","thinkingLevel":"off"} +{"type":"message","id":"63ca9e27","parentId":"8de58fab","timestamp":"2026-06-15T14:51:26.115Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`.\n\nRetry instruction: your previous response did not call the final_json tool.\n\nDo not call bash. Do not explain anything in prose, markdown, or JSON text.\n\nCall final_json exactly once with a JSON object that matches the schema."}],"timestamp":1781535086114}} +{"type":"message","id":"d010b944","parentId":"63ca9e27","timestamp":"2026-06-15T14:51:30.208Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"955334068","name":"final_json","arguments":{"caveats":["The provided context is truncated, but the core issue revolves around ACP delivery modes and state preservation during tool use."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in 'final_only' ACP delivery mode because intermediate events prematurely reset turn state."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6089,"output":88,"cacheRead":0,"cacheWrite":0,"totalTokens":6177,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535086127,"responseId":"chatcmpl-t6ua2t08uea23oj86dowf"}} +{"type":"message","id":"5b4d384e","parentId":"d010b944","timestamp":"2026-06-15T14:51:30.210Z","message":{"role":"toolResult","toolCallId":"955334068","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-0CS9OR/final-output.json"},"isError":false,"timestamp":1781535090210}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T145221Z-1677481.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T145221Z-1677481.md new file mode 100644 index 0000000000000000000000000000000000000000..a40fd610e7e72cf676e2c7283c82d899679fe927 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/prompts/20260615T145221Z-1677481.md @@ -0,0 +1,387 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T145221Z-1677481.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T145221Z-1677481.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/schemas/20260615T145221Z-1677481.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481/2026-06-15T14-52-22-368Z_019ecbc4-f1e0-71f1-aab8-e220660d3a3f.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481/2026-06-15T14-52-22-368Z_019ecbc4-f1e0-71f1-aab8-e220660d3a3f.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b7b2caea75453a5a5cafd5b600ebc4e193593d2e --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88504/sessions/20260615T145221Z-1677481/2026-06-15T14-52-22-368Z_019ecbc4-f1e0-71f1-aab8-e220660d3a3f.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc4-f1e0-71f1-aab8-e220660d3a3f","timestamp":"2026-06-15T14:52:22.368Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"b31855ab","parentId":null,"timestamp":"2026-06-15T14:52:22.433Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"e8b8f024","parentId":"b31855ab","timestamp":"2026-06-15T14:52:22.433Z","thinkingLevel":"off"} +{"type":"message","id":"6a24d822","parentId":"e8b8f024","timestamp":"2026-06-15T14:52:22.436Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535142436}} +{"type":"message","id":"273649ff","parentId":"6a24d822","timestamp":"2026-06-15T14:52:26.677Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"809176390","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6803,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6895,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535142448,"responseId":"chatcmpl-lhpip5ww68ncz2lruqgo7u"}} +{"type":"message","id":"13dc9b3a","parentId":"273649ff","timestamp":"2026-06-15T14:52:26.679Z","message":{"role":"toolResult","toolCallId":"809176390","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-9ogds2/final-output.json"},"isError":false,"timestamp":1781535146679}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T145226Z-1677597.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T145226Z-1677597.md new file mode 100644 index 0000000000000000000000000000000000000000..4f1f972458d4186c026fc4845165308b81eef4bc --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/prompts/20260615T145226Z-1677597.md @@ -0,0 +1,287 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T145226Z-1677597.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T145226Z-1677597.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/schemas/20260615T145226Z-1677597.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597/2026-06-15T14-52-27-815Z_019ecbc5-0727-796b-bc33-e87c1459dbd4.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597/2026-06-15T14-52-27-815Z_019ecbc5-0727-796b-bc33-e87c1459dbd4.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..4d541252748e6c95a4aaee7da19eba3d91d3fc7c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-88875/sessions/20260615T145226Z-1677597/2026-06-15T14-52-27-815Z_019ecbc5-0727-796b-bc33-e87c1459dbd4.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc5-0727-796b-bc33-e87c1459dbd4","timestamp":"2026-06-15T14:52:27.815Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"c3cb2e1b","parentId":null,"timestamp":"2026-06-15T14:52:27.877Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"5f72dd26","parentId":"c3cb2e1b","timestamp":"2026-06-15T14:52:27.877Z","thinkingLevel":"off"} +{"type":"message","id":"ddba3a73","parentId":"5f72dd26","timestamp":"2026-06-15T14:52:27.881Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535147881}} +{"type":"message","id":"06f9cdb0","parentId":"ddba3a73","timestamp":"2026-06-15T14:52:32.690Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5047,"output":76,"cacheRead":0,"cacheWrite":0,"totalTokens":5123,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535147896,"responseId":"chatcmpl-gag50abvl9613gg52idr2"}} +{"type":"message","id":"fa5e6058","parentId":"06f9cdb0","timestamp":"2026-06-15T14:52:33.386Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781535153386}} +{"type":"message","id":"a4d2ccf5","parentId":"fa5e6058","timestamp":"2026-06-15T14:52:37.349Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"873838095","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body clearly indicate documentation updates across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5301,"output":86,"cacheRead":0,"cacheWrite":0,"totalTokens":5387,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535153401,"responseId":"chatcmpl-wqn6lgvc40gwfwll7mpcon"}} +{"type":"message","id":"5614a61b","parentId":"a4d2ccf5","timestamp":"2026-06-15T14:52:37.351Z","message":{"role":"toolResult","toolCallId":"873838095","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-RfCKU2/final-output.json"},"isError":false,"timestamp":1781535157350}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T145130Z-1676119.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T145130Z-1676119.md new file mode 100644 index 0000000000000000000000000000000000000000..48f04f7079a3b2f686d6aa3728ea4b55df494482 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/prompts/20260615T145130Z-1676119.md @@ -0,0 +1,338 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T145130Z-1676119.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T145130Z-1676119.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/schemas/20260615T145130Z-1676119.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119/2026-06-15T14-51-31-296Z_019ecbc4-2a60-7271-952d-a698249a7edb.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119/2026-06-15T14-51-31-296Z_019ecbc4-2a60-7271-952d-a698249a7edb.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..dd38aad7d0901fbab7422c702c9f233041c81d3a --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/baseline__openclaw-openclaw-91046/sessions/20260615T145130Z-1676119/2026-06-15T14-51-31-296Z_019ecbc4-2a60-7271-952d-a698249a7edb.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc4-2a60-7271-952d-a698249a7edb","timestamp":"2026-06-15T14:51:31.296Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"be47cfde","parentId":null,"timestamp":"2026-06-15T14:51:31.359Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"c3adb4fb","parentId":"be47cfde","timestamp":"2026-06-15T14:51:31.359Z","thinkingLevel":"off"} +{"type":"message","id":"f1c74dff","parentId":"c3adb4fb","timestamp":"2026-06-15T14:51:31.363Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535091363}} +{"type":"message","id":"b5676ef1","parentId":"f1c74dff","timestamp":"2026-06-15T14:51:37.069Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"agent_runtime\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5282,"output":95,"cacheRead":0,"cacheWrite":0,"totalTokens":5377,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535091378,"responseId":"chatcmpl-0179t2xepu3twe2r3q98fle"}} +{"type":"message","id":"582524aa","parentId":"b5676ef1","timestamp":"2026-06-15T14:51:37.782Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"agent_runtime\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781535097782}} +{"type":"message","id":"9b1fa462","parentId":"582524aa","timestamp":"2026-06-15T14:51:42.640Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"422872349","name":"final_json","arguments":{"caveats":["The classification is based on the title and body, which detail changes in agent parameter handling related to specific model/provider configurations."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5574,"output":105,"cacheRead":0,"cacheWrite":0,"totalTokens":5679,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535097794,"responseId":"chatcmpl-4r4s3sx5wuk2c3ywx0m7jl"}} +{"type":"message","id":"58ade366","parentId":"9b1fa462","timestamp":"2026-06-15T14:51:42.642Z","message":{"role":"toolResult","toolCallId":"422872349","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-DG5O8u/final-output.json"},"isError":false,"timestamp":1781535102642}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/prompts/20260615T145532Z-1679974.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/prompts/20260615T145532Z-1679974.md new file mode 100644 index 0000000000000000000000000000000000000000..2bee7b68cb4344afd4575e4c9b6cd8c4cca5dc20 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/prompts/20260615T145532Z-1679974.md @@ -0,0 +1,392 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/schemas/20260615T145532Z-1679974.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/schemas/20260615T145532Z-1679974.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/schemas/20260615T145532Z-1679974.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974/2026-06-15T14-55-33-569Z_019ecbc7-dcc1-7e1d-be6e-67fb0b36c309.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974/2026-06-15T14-55-33-569Z_019ecbc7-dcc1-7e1d-be6e-67fb0b36c309.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..200a2dd1914d251940592685282f258f3417fac2 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-52126/sessions/20260615T145532Z-1679974/2026-06-15T14-55-33-569Z_019ecbc7-dcc1-7e1d-be6e-67fb0b36c309.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc7-dcc1-7e1d-be6e-67fb0b36c309","timestamp":"2026-06-15T14:55:33.569Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"bd86fbec","parentId":null,"timestamp":"2026-06-15T14:55:33.633Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"fa9efbaa","parentId":"bd86fbec","timestamp":"2026-06-15T14:55:33.633Z","thinkingLevel":"off"} +{"type":"message","id":"68a376a1","parentId":"fa9efbaa","timestamp":"2026-06-15T14:55:33.637Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535333637}} +{"type":"message","id":"aeb669e9","parentId":"68a376a1","timestamp":"2026-06-15T14:55:38.812Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"982892032","name":"final_json","arguments":{"caveats":["The classification is based on the PR title and body content, which focuses on loop detection for 'exec' tool calls. The full context of how this relates to broader OpenClaw functionality is not available."],"topics_of_interest":["tool_calling","exec_tools"],"description":"This pull request enhances loop detection by escalating repeated identical 'exec' tool calls to a critical alert level."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5587,"output":100,"cacheRead":0,"cacheWrite":0,"totalTokens":5687,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535333652,"responseId":"chatcmpl-u5mja5sxx2a0bnaowt938a4"}} +{"type":"message","id":"7ad74ccb","parentId":"aeb669e9","timestamp":"2026-06-15T14:55:38.815Z","message":{"role":"toolResult","toolCallId":"982892032","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-zKEgea/final-output.json"},"isError":false,"timestamp":1781535338815}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/prompts/20260615T145428Z-1679287.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/prompts/20260615T145428Z-1679287.md new file mode 100644 index 0000000000000000000000000000000000000000..34e2a141db2c961056989ea896ada31d56e225b5 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/prompts/20260615T145428Z-1679287.md @@ -0,0 +1,443 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/schemas/20260615T145428Z-1679287.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/schemas/20260615T145428Z-1679287.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/schemas/20260615T145428Z-1679287.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287/2026-06-15T14-54-30-106Z_019ecbc6-e4da-73d3-935c-f35fadd467fa.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287/2026-06-15T14-54-30-106Z_019ecbc6-e4da-73d3-935c-f35fadd467fa.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..ae5b4cc0329da92f9460607effe5a9bd038fa740 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-81443/sessions/20260615T145428Z-1679287/2026-06-15T14-54-30-106Z_019ecbc6-e4da-73d3-935c-f35fadd467fa.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbc6-e4da-73d3-935c-f35fadd467fa","timestamp":"2026-06-15T14:54:30.106Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"db237822","parentId":null,"timestamp":"2026-06-15T14:54:30.171Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"2c8aada8","parentId":"db237822","timestamp":"2026-06-15T14:54:30.171Z","thinkingLevel":"off"} +{"type":"message","id":"5c8293cd","parentId":"2c8aada8","timestamp":"2026-06-15T14:54:30.175Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535270174}} +{"type":"message","id":"4e6179ed","parentId":"5c8293cd","timestamp":"2026-06-15T14:54:36.563Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"794533283","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and timeout handling during downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling."],"topics_of_interest":["model_serving","gateway","memory"],"description":"This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7299,"output":115,"cacheRead":0,"cacheWrite":0,"totalTokens":7414,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535270186,"responseId":"chatcmpl-vns30kmmd0n95y6z67fvvg"}} +{"type":"message","id":"dad0ae61","parentId":"4e6179ed","timestamp":"2026-06-15T14:54:36.565Z","message":{"role":"toolResult","toolCallId":"794533283","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and timeout handling during downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\",\n \"memory\"\n ],\n \"description\": \"This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts.\"\n}"}],"details":{},"isError":true,"timestamp":1781535276565}} +{"type":"message","id":"e5e2df03","parentId":"dad0ae61","timestamp":"2026-06-15T14:54:41.898Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"805406638","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and timeout handling during downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling."],"description":"This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts.","topics_of_interest":["model_serving","gateway","memory"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7584,"output":115,"cacheRead":0,"cacheWrite":0,"totalTokens":7699,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535276565,"responseId":"chatcmpl-ea9twixxpous0bj65rtq5o"}} +{"type":"message","id":"71bfa54a","parentId":"e5e2df03","timestamp":"2026-06-15T14:54:41.899Z","message":{"role":"toolResult","toolCallId":"805406638","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible providers, and timeout handling during downloads, which touches on several topics. The classification prioritizes the core functional changes related to provider interaction and media handling.\"\n ],\n \"description\": \"This PR fixes Windows QMD shims and guards image URL downloads by routing provider-returned URLs through guarded HTTP with bounded reads and timeouts.\",\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\",\n \"memory\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535281899}} +{"type":"message","id":"c46d0655","parentId":"71bfa54a","timestamp":"2026-06-15T14:55:14.101Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe user wants me to classify a GitHub PR based on its title and context, returning only a specific JSON structure.\n\n1. **Analyze the Title:** \"fix: resolve QMD Windows shims and guard image URL downloads\".\n2. **Analyze the Body/Context:** The body details fixing Windows QMD shim paths, parsing OpenAI-compatible image responses (URL vs b64\\_json), and routing provider-returned image URLs through guarded HTTP with timeouts and limits.\n3. **Determine Topics:**\n * \"guard image URL downloads,\" \"Route provider-returned image URLs through guarded HTTP\": This strongly relates to how external services are accessed/served, pointing towards `model_serving` or potentially `gateway`. Since it involves handling responses from providers (like OpenAI), `model_serving` is appropriate for the serving aspect.\n * \"QMD Windows shims,\" \"memory-core\": QMD relates to memory indexing/management, suggesting `memory`.\n * \"Windows shims\" and general infrastructure fixes might touch on `config` or `packaging_deployment`, but these are implementation details compared to the core functional fix. The label `gateway` is present, and the body mentions routing through guarded HTTP, which aligns with gateway behavior.\n\n4. **Select Topics (Smallest set):**\n * The primary action is fixing how image data from providers is handled/downloaded securely (`model_serving`).\n * The QMD part relates to memory management (`memory`).\n * The routing aspect mentioned in the body suggests `gateway` might be relevant, but `model_serving` covers provider interaction well. Given the labels include `gateway`, and the fix involves URL routing/guarding, keeping `gateway` is justified as a second topic if it's not fully covered by `model_serving`.\n\n Let's stick to:\n * `model_serving`: For handling image responses from providers (OpenAI-compatible).\n * `memory`: For the QMD shim fix related to memory core.\n * `gateway`: Because URL routing and guarded transport reuse are mentioned, which is a gateway function.\n\n5. **Refine Topic Count:** The item touches on provider interaction (`model_serving`), infrastructure/routing (`gateway`), and local data handling (`memory`). This seems like a genuinely cross-topic item requiring 2 or 3 topics. I will use three as they represent distinct functional areas being fixed simultaneously.\n\n6. **Draft Description & Caveats:**\n * Description: Concise, evidence-backed sentence summarizing the fix (as done before).\n * Caveats: Note that multiple systems are involved.\n\nThe previous attempt failed due to a character limit in `caveats`. I must ensure the new version adheres strictly to the schema and constraints. The topics selected (`model_serving`, `gateway`, `memory`) seem correct based on the evidence."},{"type":"toolCall","id":"474161637","name":"final_json","arguments":{"caveats":["This PR addresses multiple functional areas, including Windows shims (QMD/memory), image URL parsing for providers (model_serving), and guarded HTTP routing (gateway)."],"description":"This PR resolves issues with Windows QMD shims and implements guarded HTTP downloads for provider-returned image URLs.","topics_of_interest":["model_serving","gateway","memory"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7872,"output":716,"cacheRead":0,"cacheWrite":0,"totalTokens":8588,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535281900,"responseId":"chatcmpl-mkbax47d0daxy0grrbvsnj"}} +{"type":"message","id":"123d60c2","parentId":"c46d0655","timestamp":"2026-06-15T14:55:14.102Z","message":{"role":"toolResult","toolCallId":"474161637","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-5ehMMN/final-output.json"},"isError":false,"timestamp":1781535314102}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/prompts/20260615T145401Z-1678919.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/prompts/20260615T145401Z-1678919.md new file mode 100644 index 0000000000000000000000000000000000000000..3de16ddf64ed9c7ebb99627c40f734d50d2e7c09 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/prompts/20260615T145401Z-1678919.md @@ -0,0 +1,433 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/schemas/20260615T145401Z-1678919.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/schemas/20260615T145401Z-1678919.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/schemas/20260615T145401Z-1678919.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919/2026-06-15T14-54-02-814Z_019ecbc6-7a3e-7bcf-85a6-9bf5404a7d7a.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919/2026-06-15T14-54-02-814Z_019ecbc6-7a3e-7bcf-85a6-9bf5404a7d7a.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..20e4ee486226d7fb5b051e94f37fc44d4e331f67 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-84509/sessions/20260615T145401Z-1678919/2026-06-15T14-54-02-814Z_019ecbc6-7a3e-7bcf-85a6-9bf5404a7d7a.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbc6-7a3e-7bcf-85a6-9bf5404a7d7a","timestamp":"2026-06-15T14:54:02.814Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"e4dc0083","parentId":null,"timestamp":"2026-06-15T14:54:02.876Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"f598a7fd","parentId":"e4dc0083","timestamp":"2026-06-15T14:54:02.876Z","thinkingLevel":"off"} +{"type":"message","id":"e8b1fef0","parentId":"f598a7fd","timestamp":"2026-06-15T14:54:02.883Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535242882}} +{"type":"message","id":"8d662921","parentId":"e8b1fef0","timestamp":"2026-06-15T14:54:09.542Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"918560169","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior."],"topics_of_interest":["acp","tool_calling"],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6107,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":6218,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535242897,"responseId":"chatcmpl-xrgcx5ktll8uub710krk59"}} +{"type":"message","id":"1bbdb9dc","parentId":"8d662921","timestamp":"2026-06-15T14:54:09.545Z","message":{"role":"toolResult","toolCallId":"918560169","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781535249544}} +{"type":"message","id":"4fc66615","parentId":"1bbdb9dc","timestamp":"2026-06-15T14:54:14.702Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"447165157","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6383,"output":111,"cacheRead":0,"cacheWrite":0,"totalTokens":6494,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535249545,"responseId":"chatcmpl-jq719gemd7o529c2b1z8d7"}} +{"type":"message","id":"815f52c7","parentId":"4fc66615","timestamp":"2026-06-15T14:54:14.704Z","message":{"role":"toolResult","toolCallId":"447165157","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff related to ACP protocol handling for text preservation during tool use in 'final_only' delivery mode. The classification focuses on the mechanism described rather than general agent behavior.\"\n ],\n \"description\": \"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535254704}} +{"type":"message","id":"1afd87f9","parentId":"815f52c7","timestamp":"2026-06-15T14:54:21.721Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe previous attempt failed due to a constraint violation on the `caveats` field length, although the content was fine. I will re-submit with a slightly shorter caveat while keeping the core classification intact, as it accurately reflects the PR's focus (ACP protocol + tool interaction semantics)."},{"type":"toolCall","id":"508706899","name":"final_json","arguments":{"caveats":["Context is a PR fixing text loss in final_only ACP delivery mode during multi-step agentic turns."],"description":"This PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode by preserving accumulated turn state across intermediate done events during tool use.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6662,"output":153,"cacheRead":0,"cacheWrite":0,"totalTokens":6815,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535254704,"responseId":"chatcmpl-jav026rqvxnl12aiq9d4i"}} +{"type":"message","id":"340f10d7","parentId":"1afd87f9","timestamp":"2026-06-15T14:54:21.721Z","message":{"role":"toolResult","toolCallId":"508706899","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-QwL7Xp/final-output.json"},"isError":false,"timestamp":1781535261721}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/prompts/20260615T145514Z-1679691.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/prompts/20260615T145514Z-1679691.md new file mode 100644 index 0000000000000000000000000000000000000000..6740500740acaec71e0b6c3150334c91afe16b20 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/prompts/20260615T145514Z-1679691.md @@ -0,0 +1,394 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/schemas/20260615T145514Z-1679691.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/schemas/20260615T145514Z-1679691.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/schemas/20260615T145514Z-1679691.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691/2026-06-15T14-55-15-145Z_019ecbc7-94c9-7e48-ac23-b99d2b44f643.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691/2026-06-15T14-55-15-145Z_019ecbc7-94c9-7e48-ac23-b99d2b44f643.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5a2a07ecdc02566a88a6a3258fa6ef9b49cd935f --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88504/sessions/20260615T145514Z-1679691/2026-06-15T14-55-15-145Z_019ecbc7-94c9-7e48-ac23-b99d2b44f643.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc7-94c9-7e48-ac23-b99d2b44f643","timestamp":"2026-06-15T14:55:15.145Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"f48f5ee0","parentId":null,"timestamp":"2026-06-15T14:55:15.208Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ea59d1c5","parentId":"f48f5ee0","timestamp":"2026-06-15T14:55:15.208Z","thinkingLevel":"off"} +{"type":"message","id":"31556303","parentId":"ea59d1c5","timestamp":"2026-06-15T14:55:15.212Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535315211}} +{"type":"message","id":"175aef5b","parentId":"31556303","timestamp":"2026-06-15T14:55:21.476Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"629129342","name":"final_json","arguments":{"caveats":["The provided context is a large PR description and diff, but the core change revolves around memory slot architecture updates. The classification relies heavily on the title and body summary regarding memory roles."],"topics_of_interest":["memory","config"],"description":"This PR introduces a multi-slot memory role architecture to allow memory plugins to compose instead of replacing each other via a single global selector."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6872,"output":97,"cacheRead":0,"cacheWrite":0,"totalTokens":6969,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535315223,"responseId":"chatcmpl-6bkedu5p10cc9wlrcywldk"}} +{"type":"message","id":"5bc81ea6","parentId":"175aef5b","timestamp":"2026-06-15T14:55:21.477Z","message":{"role":"toolResult","toolCallId":"629129342","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-mc7bgi/final-output.json"},"isError":false,"timestamp":1781535321477}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/prompts/20260615T145521Z-1679814.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/prompts/20260615T145521Z-1679814.md new file mode 100644 index 0000000000000000000000000000000000000000..124e366cd930374b6c82d1e22ed4fb90276ffd3c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/prompts/20260615T145521Z-1679814.md @@ -0,0 +1,294 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/schemas/20260615T145521Z-1679814.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/schemas/20260615T145521Z-1679814.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/schemas/20260615T145521Z-1679814.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814/2026-06-15T14-55-22-746Z_019ecbc7-b27a-7f99-9755-dc3424f9b6e9.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814/2026-06-15T14-55-22-746Z_019ecbc7-b27a-7f99-9755-dc3424f9b6e9.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..ea9cfa2cb57f87a55b11516b152393dfb8d3202c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-88875/sessions/20260615T145521Z-1679814/2026-06-15T14-55-22-746Z_019ecbc7-b27a-7f99-9755-dc3424f9b6e9.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc7-b27a-7f99-9755-dc3424f9b6e9","timestamp":"2026-06-15T14:55:22.746Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ea21d039","parentId":null,"timestamp":"2026-06-15T14:55:22.807Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"cd4308c6","parentId":"ea21d039","timestamp":"2026-06-15T14:55:22.807Z","thinkingLevel":"off"} +{"type":"message","id":"030e8b95","parentId":"cd4308c6","timestamp":"2026-06-15T14:55:22.811Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535322810}} +{"type":"message","id":"adc60bd3","parentId":"030e8b95","timestamp":"2026-06-15T14:55:27.717Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\", \"gateway\"], \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5116,"output":77,"cacheRead":0,"cacheWrite":0,"totalTokens":5193,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535322826,"responseId":"chatcmpl-ls0evsdlekghm46lduy65j"}} +{"type":"message","id":"852b4e4b","parentId":"adc60bd3","timestamp":"2026-06-15T14:55:28.437Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\",\n \"gateway\"\n ],\n \"description\": \"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781535328437}} +{"type":"message","id":"14807ae0","parentId":"852b4e4b","timestamp":"2026-06-15T14:55:32.501Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"556836883","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body indicate a documentation effort across multiple subsystems."],"topics_of_interest":["docs","gateway"],"description":"This PR primarily focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, and CLI contracts by adding JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5372,"output":87,"cacheRead":0,"cacheWrite":0,"totalTokens":5459,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535328452,"responseId":"chatcmpl-9isfe6532hlmsxhhzcgw8k"}} +{"type":"message","id":"81742635","parentId":"14807ae0","timestamp":"2026-06-15T14:55:32.503Z","message":{"role":"toolResult","toolCallId":"556836883","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AAJlbT/final-output.json"},"isError":false,"timestamp":1781535332503}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/prompts/20260615T145421Z-1679174.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/prompts/20260615T145421Z-1679174.md new file mode 100644 index 0000000000000000000000000000000000000000..6bd3d8e05ccf78dd064fdabfdcef40d7b7aacf90 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/prompts/20260615T145421Z-1679174.md @@ -0,0 +1,345 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Evidence Before Final Output + +Do not rush to the final structured output for code-specific routing. First, +decide whether one narrow read-only repository lookup would materially reduce +topic ambiguity. If yes, inspect the named source area, then call the final +structured output. If no, answer directly from the supplied GitHub context. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/schemas/20260615T145421Z-1679174.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/schemas/20260615T145421Z-1679174.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/schemas/20260615T145421Z-1679174.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174/2026-06-15T14-54-22-749Z_019ecbc6-c81d-725e-98c0-58aac5ff2af4.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174/2026-06-15T14-54-22-749Z_019ecbc6-c81d-725e-98c0-58aac5ff2af4.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..52c3cc1b627b8c75e672041f74609f6816759c7b --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/final-after-evidence__openclaw-openclaw-91046/sessions/20260615T145421Z-1679174/2026-06-15T14-54-22-749Z_019ecbc6-c81d-725e-98c0-58aac5ff2af4.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc6-c81d-725e-98c0-58aac5ff2af4","timestamp":"2026-06-15T14:54:22.749Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"960e1b59","parentId":null,"timestamp":"2026-06-15T14:54:22.809Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"4d2fe30e","parentId":"960e1b59","timestamp":"2026-06-15T14:54:22.809Z","thinkingLevel":"off"} +{"type":"message","id":"6478339d","parentId":"4d2fe30e","timestamp":"2026-06-15T14:54:22.816Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Evidence Before Final Output\n\nDo not rush to the final structured output for code-specific routing. First,\ndecide whether one narrow read-only repository lookup would materially reduce\ntopic ambiguity. If yes, inspect the named source area, then call the final\nstructured output. If no, answer directly from the supplied GitHub context.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535262815}} +{"type":"message","id":"110dfa09","parentId":"6478339d","timestamp":"2026-06-15T14:54:28.753Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"797301860","name":"final_json","arguments":{"caveats":["The PR addresses a specific provider routing issue related to DeepSeek V4 thinking wrapper compatibility with Microsoft Foundry alias providers."],"topics_of_interest":["agent_runtime","local_model_providers"],"description":"This PR fixes an agent runtime bug where alias providers for microsoft-foundry incorrectly triggered the DeepSeek V4 thinking wrapper due to an exact provider ID match instead of a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5351,"output":100,"cacheRead":0,"cacheWrite":0,"totalTokens":5451,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535262827,"responseId":"chatcmpl-brpc2uq4fahy54iewhzr7"}} +{"type":"message","id":"756a5636","parentId":"110dfa09","timestamp":"2026-06-15T14:54:28.755Z","message":{"role":"toolResult","toolCallId":"797301860","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gNtwEn/final-output.json"},"isError":false,"timestamp":1781535268755}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/prompts/20260615T145356Z-1678809.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/prompts/20260615T145356Z-1678809.md new file mode 100644 index 0000000000000000000000000000000000000000..c8da25fb56950947a6bce5be88af7491f40e3328 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/prompts/20260615T145356Z-1678809.md @@ -0,0 +1,394 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#52126` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 52126 +- URL: https://github.com/openclaw/openclaw/pull/52126 +- Title: fix: extend loopDetection to cover exec tool calls (#34574) +- State: closed +- Author: poushwell +- Labels: agents, size: S +- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts + +Body: +```markdown +**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts. + +**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec. + +**Changes:** +- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns) +- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6) +- No change to enabled/disabled defaults +- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged + +**Testing:** +- `vitest run src/agents/tool-loop-detection.test.ts` — all passed +- Existing loop detection behavior unchanged for non-exec tools + +Closes #34574 + +``` + +Comments/context (truncated): +```markdown +- greptile-apps[bot] at 2026-03-22T07:10:03Z: +

Greptile Summary

+ +This PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured. + +- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns. +- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation. +- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin + +[comments/context truncated: 6548 characters omitted] + +tes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9). +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts +index 056c5286cbbfd..ed0b7bb2e3f0b 100644 +--- a/src/agents/tool-loop-detection.test.ts ++++ b/src/agents/tool-loop-detection.test.ts +@@ -1,4 +1,4 @@ +-import { describe, expect, it } from "vitest"; ++import { describe, expect, it } from "vitest"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { +@@ -249,6 +249,17 @@ describe("tool-loop-detection", () => { + }); + + describe("detectToolCallLoop", () => { ++ const execThresholdConfig: ToolLoopDetectionConfig = { ++ enabled: true, ++ warningThreshold: 3, ++ criticalThreshold: 6, ++ detectors: { ++ genericRepeat: true, ++ knownPollNoProgress: true, ++ pingPong: true, ++ }, ++ }; ++ + it("is disabled by default", () => { + const state = createState(); + +@@ -276,6 +287,112 @@ describe("tool-loop-detection", () => { + expect(result.stuck).toBe(false); + }); + ++ it("warns for repeated exec calls at repeat threshold", () => { ++ const result = detectLoopAfterRepeatedCalls({ ++ toolName: "exec", ++ toolParams: { command: "ls /tmp" }, ++ result: { ++ content: [{ type: "text", text: "file-a\nfile-b" }], ++ details: { status: "completed", exitCode: 0 }, ++ }, ++ count: 3, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ } + +[file diff truncated: 2223 characters omitted] + +toolName: "read", ++ toolParams: { path: "a.txt" }, ++ result: { ++ content: [{ type: "text", text: "same file data" }], ++ details: { ok: true }, ++ }, ++ count: 4, ++ config: execThresholdConfig, ++ }); ++ ++ expect(result.stuck).toBe(true); ++ if (result.stuck) { ++ expect(result.level).toBe("warning"); ++ expect(result.detector).toBe("generic_repeat"); ++ } ++ }); ++ + it("warns on generic repeated tool+args calls", () => { + const state = createState(); + for (let i = 0; i < WARNING_THRESHOLD; i += 1) { + +diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts +index 1576e7ace9baf..7758bbfc59a9b 100644 +--- a/src/agents/tool-loop-detection.ts ++++ b/src/agents/tool-loop-detection.ts +@@ -1,4 +1,4 @@ +-import { createHash } from "node:crypto"; ++import { createHash } from "node:crypto"; + import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; + import type { SessionState } from "../logging/diagnostic-session-state.js"; + import { createSubsystemLogger } from "../logging/subsystem.js"; +@@ -470,10 +470,29 @@ export function detectToolCallLoop( + }; + } + +- // Generic detector: warn-only for repeated identical calls. ++ // Generic detector: warn on repeated identical calls for all tools. ++ // Exec is higher risk, so it escalates to critical at the configured critical threshold. + const recentCount = history.filter( + (h) => h.toolName === toolName && h.argsHash === currentHash, + ).length; ++ const isExecTool = toolName === "exec"; ++ ++ if ( ++ !knownPollTool && ++ isExecTool && ++ resolvedConfig.detectors.genericRepeat && ++ recentCount >= resolvedConfig.criticalThreshold ++ ) { ++ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`); ++ return { ++ stuck: true, ++ level: "critical", ++ detector: "generic_repeat", ++ count: recentCount, ++ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`, ++ warningKey: `generic:${toolName}:${currentHash}`, ++ }; ++ } + + if ( + !knownPollTool && + + +[diff truncated from 6143 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/schemas/20260615T145356Z-1678809.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/schemas/20260615T145356Z-1678809.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/schemas/20260615T145356Z-1678809.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809/2026-06-15T14-53-57-491Z_019ecbc6-6573-7be1-b466-9c2cbe76f266.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809/2026-06-15T14-53-57-491Z_019ecbc6-6573-7be1-b466-9c2cbe76f266.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..472d507bdb0246fb808d236c951301d28212fa36 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-52126/sessions/20260615T145356Z-1678809/2026-06-15T14-53-57-491Z_019ecbc6-6573-7be1-b466-9c2cbe76f266.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc6-6573-7be1-b466-9c2cbe76f266","timestamp":"2026-06-15T14:53:57.491Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"00df9d12","parentId":null,"timestamp":"2026-06-15T14:53:57.552Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"040b13d9","parentId":"00df9d12","timestamp":"2026-06-15T14:53:57.552Z","thinkingLevel":"off"} +{"type":"message","id":"1e60736b","parentId":"040b13d9","timestamp":"2026-06-15T14:53:57.557Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#52126`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 52126\n- URL: https://github.com/openclaw/openclaw/pull/52126\n- Title: fix: extend loopDetection to cover exec tool calls (#34574)\n- State: closed\n- Author: poushwell\n- Labels: agents, size: S\n- Changed files: src/agents/tool-loop-detection.test.ts, src/agents/tool-loop-detection.ts\n\nBody:\n```markdown\n**What:** loopDetection did not escalate to critical for repeated exec calls. 121 identical shell commands = zero critical alerts.\r\n\r\n**Why:** exec is the most dangerous tool type. The generic repeat detector was warn-only for non-poll tools, so criticalThreshold never triggered for exec.\r\n\r\n**Changes:**\r\n- Added escalation path for exec tool in loop detection: repeated identical exec calls now trigger critical at criticalThreshold (same as other dangerous patterns)\r\n- Default thresholds unchanged (warningThreshold: 3, criticalThreshold: 6)\r\n- No change to enabled/disabled defaults\r\n- 4 new tests: repeated exec alert, different commands no alert, below threshold no alert, existing non-exec unchanged\r\n\r\n**Testing:**\r\n- `vitest run src/agents/tool-loop-detection.test.ts` — all passed\r\n- Existing loop detection behavior unchanged for non-exec tools\r\n\r\nCloses #34574\r\n\n```\n\nComments/context (truncated):\n```markdown\n- greptile-apps[bot] at 2026-03-22T07:10:03Z:\n

Greptile Summary

\n\nThis PR extends `detectToolCallLoop` so that repeated identical `exec` calls escalate to `critical` at `criticalThreshold`, filling a gap where the generic repeat detector was warn-only for non-poll tools. The implementation is correct: a new guard checks `isExecTool && recentCount >= criticalThreshold` before the existing generic warning block, giving `exec` a warning at `warningThreshold` and a critical at `criticalThreshold` — consistent with how `known_poll_no_progress` is structured.\n\n- The logic in `tool-loop-detection.ts` is sound and consistent with existing detector patterns.\n- The `warningKey` format (`generic:${toolName}:${currentHash}`) is shared between the new critical block and the existing warning block, which is consistent with how `known_poll_no_progress` handles the same situation.\n- The four new tests cover warning, below-threshold, different-args, and non-exec regression cases — but **no test verifies the core new behavior**: exec reachin\n\n[comments/context truncated: 6548 characters omitted]\n\ntes: reviewed against [bc73141e8284](https://github.com/openclaw/openclaw/commit/bc73141e8284c219933970dbd4f6aeacb05bbb77); fix evidence: release [v2026.4.23](https://github.com/openclaw/openclaw/releases/tag/v2026.4.23), commit [a9797214338b](https://github.com/openclaw/openclaw/commit/a9797214338ba31c52c796adbb75afb16e0684a9).\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/agents/tool-loop-detection.test.ts b/src/agents/tool-loop-detection.test.ts\nindex 056c5286cbbfd..ed0b7bb2e3f0b 100644\n--- a/src/agents/tool-loop-detection.test.ts\n+++ b/src/agents/tool-loop-detection.test.ts\n@@ -1,4 +1,4 @@\n-import { describe, expect, it } from \"vitest\";\n+import { describe, expect, it } from \"vitest\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import {\n@@ -249,6 +249,17 @@ describe(\"tool-loop-detection\", () => {\n });\n \n describe(\"detectToolCallLoop\", () => {\n+ const execThresholdConfig: ToolLoopDetectionConfig = {\n+ enabled: true,\n+ warningThreshold: 3,\n+ criticalThreshold: 6,\n+ detectors: {\n+ genericRepeat: true,\n+ knownPollNoProgress: true,\n+ pingPong: true,\n+ },\n+ };\n+\n it(\"is disabled by default\", () => {\n const state = createState();\n \n@@ -276,6 +287,112 @@ describe(\"tool-loop-detection\", () => {\n expect(result.stuck).toBe(false);\n });\n \n+ it(\"warns for repeated exec calls at repeat threshold\", () => {\n+ const result = detectLoopAfterRepeatedCalls({\n+ toolName: \"exec\",\n+ toolParams: { command: \"ls /tmp\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"file-a\\nfile-b\" }],\n+ details: { status: \"completed\", exitCode: 0 },\n+ },\n+ count: 3,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ }\n\n[file diff truncated: 2223 characters omitted]\n\ntoolName: \"read\",\n+ toolParams: { path: \"a.txt\" },\n+ result: {\n+ content: [{ type: \"text\", text: \"same file data\" }],\n+ details: { ok: true },\n+ },\n+ count: 4,\n+ config: execThresholdConfig,\n+ });\n+\n+ expect(result.stuck).toBe(true);\n+ if (result.stuck) {\n+ expect(result.level).toBe(\"warning\");\n+ expect(result.detector).toBe(\"generic_repeat\");\n+ }\n+ });\n+\n it(\"warns on generic repeated tool+args calls\", () => {\n const state = createState();\n for (let i = 0; i < WARNING_THRESHOLD; i += 1) {\n\ndiff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts\nindex 1576e7ace9baf..7758bbfc59a9b 100644\n--- a/src/agents/tool-loop-detection.ts\n+++ b/src/agents/tool-loop-detection.ts\n@@ -1,4 +1,4 @@\n-import { createHash } from \"node:crypto\";\n+import { createHash } from \"node:crypto\";\n import type { ToolLoopDetectionConfig } from \"../config/types.tools.js\";\n import type { SessionState } from \"../logging/diagnostic-session-state.js\";\n import { createSubsystemLogger } from \"../logging/subsystem.js\";\n@@ -470,10 +470,29 @@ export function detectToolCallLoop(\n };\n }\n \n- // Generic detector: warn-only for repeated identical calls.\n+ // Generic detector: warn on repeated identical calls for all tools.\n+ // Exec is higher risk, so it escalates to critical at the configured critical threshold.\n const recentCount = history.filter(\n (h) => h.toolName === toolName && h.argsHash === currentHash,\n ).length;\n+ const isExecTool = toolName === \"exec\";\n+\n+ if (\n+ !knownPollTool &&\n+ isExecTool &&\n+ resolvedConfig.detectors.genericRepeat &&\n+ recentCount >= resolvedConfig.criticalThreshold\n+ ) {\n+ log.error(`Critical exec loop detected: ${toolName} called ${recentCount} times identically`);\n+ return {\n+ stuck: true,\n+ level: \"critical\",\n+ detector: \"generic_repeat\",\n+ count: recentCount,\n+ message: `CRITICAL: You have called ${toolName} ${recentCount} times with identical arguments. Session execution blocked to prevent runaway command loops.`,\n+ warningKey: `generic:${toolName}:${currentHash}`,\n+ };\n+ }\n \n if (\n !knownPollTool &&\n\n\n[diff truncated from 6143 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535237556}} +{"type":"message","id":"dd6f4220","parentId":"1e60736b","timestamp":"2026-06-15T14:54:01.673Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"382428520","name":"final_json","arguments":{"caveats":["The analysis relies on the provided PR description and diff snippets; full context might be unavailable."],"topics_of_interest":["exec_tools","tool_calling"],"description":"This PR extends loop detection to escalate repeated identical 'exec' tool calls to a critical alert level."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5609,"output":76,"cacheRead":0,"cacheWrite":0,"totalTokens":5685,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535237572,"responseId":"chatcmpl-cnvzlg4n96kkdn9dsbb5m"}} +{"type":"message","id":"4ea2980b","parentId":"dd6f4220","timestamp":"2026-06-15T14:54:01.675Z","message":{"role":"toolResult","toolCallId":"382428520","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-gJfxRo/final-output.json"},"isError":false,"timestamp":1781535241674}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/prompts/20260615T145318Z-1678298.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/prompts/20260615T145318Z-1678298.md new file mode 100644 index 0000000000000000000000000000000000000000..33876f4aa86005a873a34353c4920e903954a3b5 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/prompts/20260615T145318Z-1678298.md @@ -0,0 +1,445 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#81443` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 81443 +- URL: https://github.com/openclaw/openclaw/pull/81443 +- Title: fix: resolve QMD Windows shims and guard image URL downloads +- State: open +- Author: knightplat-blip +- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot +- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md + +Body (truncated): +```markdown +## Summary + +Fixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path. + +- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints. +- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution. +- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`. +- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts. +- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope. + +## Behavior addressed + +Windows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover. + +## Real environment tested + +- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`. +- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`. +- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`. + +## Exact steps or command run after this patch + +```bash +node scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts +node --max-old-space-size=8192 --import tsx scripts/generat + +[body truncated: 1193 characters omitted] + +-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy. +- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch. +- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download. + +## What was not tested + +Full live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files. + +``` + +Comments/context (truncated): +```markdown +- knightplat-blip at 2026-05-13T14:51:39Z: +@clawsweeper re-review + + +- clawsweeper[bot] at 2026-05-13T14:51:46Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._ + +**Summary** +This PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files. + +PR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files. + +Reproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested. + +**Review metrics:** 3 noteworthy metrics. +- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before + +[comments/context truncated: 39842 characters omitted] + +:43Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. + +- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z: +This assigned pull request has been automatically marked as stale after being open for 27 days. +Please add updates or it will be closed. +``` + +Diff/context (selected/truncated): +```diff +diff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts +index 104aac4c1c61d..e3f9900addc86 100644 +--- a/extensions/openai/image-generation-provider.test.ts ++++ b/extensions/openai/image-generation-provider.test.ts +@@ -7,10 +7,14 @@ const { + isProviderApiKeyConfiguredMock, + listProfilesForProviderMock, + resolveApiKeyForProviderMock, ++ fetchWithTimeoutGuardedMock, ++ createProviderOperationDeadlineMock, + postJsonRequestMock, + postMultipartRequestMock, + assertOkOrThrowHttpErrorMock, + resolveProviderHttpRequestConfigMock, ++ resolveProviderOperationRemainingTimeoutMsMock, ++ resolveProviderOperationTimeoutMsMock, + sanitizeConfiguredModelProviderRequestMock, + logInfoMock, + } = vi.hoisted(() => ({ +@@ -31,6 +35,11 @@ const { + apiKey: "openai-key", + }), + ), ++ fetchWithTimeoutGuardedMock: vi.fn(), ++ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({ ++ timeoutMs: params.timeoutMs, ++ label: params.label, ++ })), + postJsonRequestMock: vi.fn(), + postMultipartRequestMock: vi.fn(), + assertOkOrThrowHttpErrorMock: vi.fn(async () => {}), +@@ -46,6 +55,14 @@ const { + dispatcherPolicy: undefined, + }; + }), ++ resolveProviderOperationTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), ++ resolveProviderOperationRemainingTimeoutMsMock: vi.fn( ++ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) => ++ params.deadline.timeoutMs ?? params.defaultTimeoutMs, ++ ), + sanitizeConfiguredMo + +[file diff truncated: 7408 characters omitted] + + await expect( ++ provider.generateImage({ ++ provider: "openai", ++ model: "gpt-image-2", ++ prompt: "test", ++ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } }, ++ }), ++ ).rejects.toThrow("OpenAI image URL download exceeded 1 bytes"); ++ expect(requestRelease).toHaveBeenCalledOnce(); ++ expect(downloadRelease).toHaveBeenCalledOnce(); ++ }); ++ + it("wraps malformed successful OpenAI image responses", async () => { + postJsonRequestMock.mockResolvedValue({ + response: { json: async () => ({ data: { b64_json: "not-an-array" } }) }, + +diff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts +index 4b0e64bd66c7b..f871d62a446bc 100644 +--- a/extensions/openai/image-generation-provider.ts ++++ b/extensions/openai/image + +[file diff truncated: 6036 characters omitted] + + + +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml +index 09f3aa93f0970..65a0f47250cf3 100644 +--- a/pnpm-lock.yaml ++++ b/pnpm-lock.yaml +@@ -274,6 +274,9 @@ importers: + lit: + specifier: 3.3.3 + version: 3.3.3 ++ node-llama-cpp: ++ specifier: ^3.18.1 ++ version: 3.18.1(typescript@6.0.3) + oxfmt: + specifier: 0.52.0 + version: 0.52.0 +@@ -1942,7 +1945,7 @@ importers: + version: 14.1.2 + '@vitest/browser-playwright': + specifier: 4.1.7 +- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) ++ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7) + jsdom: + specifier: 29.1.1 + version: 29.1.1(@noble/hashes@2.0.1) +@@ -1951,10 +1954,10 @@ importers: + version: 1.60.0 + vite: + specifier: 8.0.14 +- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) ++ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0) + vitest: + specifier: 4.1.7 +- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) ++ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2 + +[file diff truncated: 100450 characters omitted] + +.9.2 +- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7) +- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) +- jsdom: 29.1.1(@noble/hashes@2.0.1) +- transitivePeerDependencies: +- - msw +- + void-elements@3.1.0: {} + + vscode-jsonrpc@8.2.1: {} +@@ -14008,7 +14073,7 @@ snapshots: + form-data: 2.5.4 + json-bigint: 1.0.0 + pako: 2.1.0 +- semver: 7.8.2 ++ semver: 7.8.1 + spark-md5: 3.0.2 + tough-cookie: 4.1.3 + ws: 8.21.0 + +diff --git a/src/gateway/server-cr + +[file diff truncated: 799 characters omitted] + + + +[diff truncated from 173937 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/schemas/20260615T145318Z-1678298.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/schemas/20260615T145318Z-1678298.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/schemas/20260615T145318Z-1678298.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298/2026-06-15T14-53-19-223Z_019ecbc5-cff7-7587-81c7-cbffe0dba95e.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298/2026-06-15T14-53-19-223Z_019ecbc5-cff7-7587-81c7-cbffe0dba95e.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d36b94ffad5083c14a1f7be92479657b96955952 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-81443/sessions/20260615T145318Z-1678298/2026-06-15T14-53-19-223Z_019ecbc5-cff7-7587-81c7-cbffe0dba95e.jsonl @@ -0,0 +1,10 @@ +{"type":"session","version":3,"id":"019ecbc5-cff7-7587-81c7-cbffe0dba95e","timestamp":"2026-06-15T14:53:19.223Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"1f526dca","parentId":null,"timestamp":"2026-06-15T14:53:19.288Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"3c818734","parentId":"1f526dca","timestamp":"2026-06-15T14:53:19.288Z","thinkingLevel":"off"} +{"type":"message","id":"934af235","parentId":"3c818734","timestamp":"2026-06-15T14:53:19.291Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#81443`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 81443\n- URL: https://github.com/openclaw/openclaw/pull/81443\n- Title: fix: resolve QMD Windows shims and guard image URL downloads\n- State: open\n- Author: knightplat-blip\n- Labels: docs, gateway, extensions: memory-core, agents, stale, size: XL, extensions: openai, extensions: litellm, extensions: deepinfra, triage: needs-real-behavior-proof, extensions: xai, dependencies-changed, P2, rating: šŸ§‚ unranked krab, merge-risk: 🚨 compatibility, merge-risk: 🚨 auth-provider, merge-risk: 🚨 security-boundary, status: šŸ“£ needs proof, proof: šŸ“ø screenshot\n- Changed files: docs/plugins/sdk-migration.md, docs/plugins/sdk-subpaths.md, extensions/deepinfra/image-generation-provider.test.ts, extensions/litellm/image-generation-provider.test.ts, extensions/memory-core/src/memory/qmd-manager.test.ts, extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.test.ts, extensions/memory-core/src/tools.ts, extensions/openai/image-generation-provider.test.ts, extensions/openai/image-generation-provider.ts, extensions/xai/image-generation-provider.test.ts, package.json, packages/memory-host-sdk/src/host/qmd-process.test.ts, packages/memory-host-sdk/src/host/qmd-process.ts, pnpm-lock.yaml, src/agents/embedded-agent-runner/run/CLAUDE.md, src/agents/embedded-agent-runner/run/CLAUDE.md, src/gateway/server-cron.ts, src/image-generation/image-assets.test.ts, src/image-generation/image-assets.ts, src/image-generation/openai-compatible-image-provider.test.ts, src/image-generation/openai-compatible-image-provider.ts, src/media-understanding/shared.test.ts, src/media-understanding/shared.ts, src/plugin-sdk/image-generation.ts, src/plugin-sdk/provider-http.ts, src/plugin-sdk/windows-spawn.ts, test/CLAUDE.md, test/CLAUDE.md\n\nBody (truncated):\n```markdown\n## Summary\n\nFixes the Windows QMD shim path and narrows the image URL work into a guarded provider-download path.\n\n- Resolve Windows `.cmd` shims that point at quoted absolute JavaScript entrypoints.\n- Use the real QMD package name, `@tobilu/qmd`, for package-bin fallback resolution.\n- Parse OpenAI-compatible image responses that return `data[].url` instead of `data[].b64_json`.\n- Route provider-returned image URLs through guarded HTTP with bounded reads, MIME validation, scoped same-origin transport reuse, configured media limits, and operation-deadline timeouts.\n- Dropped the unrelated `node-llama-cpp` dependency/lockfile churn from the original PR scope.\n\n## Behavior addressed\n\nWindows QMD availability checks no longer fail when `qmd.cmd` wraps a quoted absolute Node entrypoint instead of a `%~dp0`-relative entrypoint. OpenAI-compatible URL-backed image generation responses now produce image assets without using raw fetch or broad private-network carryover.\n\n## Real environment tested\n\n- AWS Crabbox native Windows: `cbx_36917d25d801`, run `run_0dd48bf72083`, hydrate workflow `26722175678`.\n- AWS Crabbox Windows WSL2: `cbx_92cdb109d982`, run `run_740f8e92e641`, hydrate workflow `26721781232`.\n- AWS Crabbox Linux changed gate after rebase: `cbx_0b074a7498e9`, run `run_72f46782c53c`.\n\n## Exact steps or command run after this patch\n\n```bash\nnode scripts/run-vitest.mjs src/plugin-sdk/windows-spawn.test.ts packages/memory-host-sdk/src/host/qmd-process.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts src/image-generation/image-assets.test.ts src/image-generation/openai-compatible-image-provider.test.ts extensions/openai/image-generation-provider.test.ts\nnode --max-old-space-size=8192 --import tsx scripts/generat\n\n[body truncated: 1193 characters omitted]\n\n-origin provider-returned URLs do not inherit provider private-network/dispatcher/auth policy.\n- Same-origin provider-returned URLs keep provider auth/transport policy and still use guarded fetch.\n- URL downloads honor configured generated-media byte limits and share the image operation deadline instead of resetting timeout per download.\n\n## What was not tested\n\nFull live QMD memory indexing/search was not run. The final `pnpm check:changed` gate is blocked by a current `origin/main` type error in untouched `src/channels/message/ingress-queue.test.ts` from `b0679d1f13d`; this PR does not touch channel ingress queue files.\n\n```\n\nComments/context (truncated):\n```markdown\n- knightplat-blip at 2026-05-13T14:51:39Z:\n@clawsweeper re-review\r\n\n\n- clawsweeper[bot] at 2026-05-13T14:51:46Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 7:57 PM ET / 23:57 UTC._\n\n**Summary**\nThis PR changes Windows QMD spawn/package resolution, OpenAI-compatible URL-backed image parsing/downloads, provider timeout SDK helpers, memory_search timeout behavior, docs/tests, and root dependency files.\n\nPR surface: Source +308, Tests +545, Docs 0, Config +1, Other +65. Total +919 across 29 files.\n\nReproducibility: yes. at source level: current main resolves QMD package fallbacks against the old qmd package name and only parses b64_json image entries. I did not establish live exact-head Windows QMD indexing/search proof, and the PR body says that full path was not tested.\n\n**Review metrics:** 3 noteworthy metrics.\n- **Dependency Graph Change:** 1 devDependency added, 1 lockfile changed. External root dependency graph changes are blocked by repository automation and require security/admin handling before\n\n[comments/context truncated: 39842 characters omitted]\n\n:43Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n\n- openclaw-barnacle[bot] at 2026-06-14T05:13:26Z:\nThis assigned pull request has been automatically marked as stale after being open for 27 days.\nPlease add updates or it will be closed.\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/extensions/openai/image-generation-provider.test.ts b/extensions/openai/image-generation-provider.test.ts\nindex 104aac4c1c61d..e3f9900addc86 100644\n--- a/extensions/openai/image-generation-provider.test.ts\n+++ b/extensions/openai/image-generation-provider.test.ts\n@@ -7,10 +7,14 @@ const {\n isProviderApiKeyConfiguredMock,\n listProfilesForProviderMock,\n resolveApiKeyForProviderMock,\n+ fetchWithTimeoutGuardedMock,\n+ createProviderOperationDeadlineMock,\n postJsonRequestMock,\n postMultipartRequestMock,\n assertOkOrThrowHttpErrorMock,\n resolveProviderHttpRequestConfigMock,\n+ resolveProviderOperationRemainingTimeoutMsMock,\n+ resolveProviderOperationTimeoutMsMock,\n sanitizeConfiguredModelProviderRequestMock,\n logInfoMock,\n } = vi.hoisted(() => ({\n@@ -31,6 +35,11 @@ const {\n apiKey: \"openai-key\",\n }),\n ),\n+ fetchWithTimeoutGuardedMock: vi.fn(),\n+ createProviderOperationDeadlineMock: vi.fn((params: Record) => ({\n+ timeoutMs: params.timeoutMs,\n+ label: params.label,\n+ })),\n postJsonRequestMock: vi.fn(),\n postMultipartRequestMock: vi.fn(),\n assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),\n@@ -46,6 +55,14 @@ const {\n dispatcherPolicy: undefined,\n };\n }),\n+ resolveProviderOperationTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n+ resolveProviderOperationRemainingTimeoutMsMock: vi.fn(\n+ (params: { deadline: { timeoutMs?: number }; defaultTimeoutMs: number }) =>\n+ params.deadline.timeoutMs ?? params.defaultTimeoutMs,\n+ ),\n sanitizeConfiguredMo\n\n[file diff truncated: 7408 characters omitted]\n\n await expect(\n+ provider.generateImage({\n+ provider: \"openai\",\n+ model: \"gpt-image-2\",\n+ prompt: \"test\",\n+ cfg: { agents: { defaults: { mediaMaxMb: 1 / (1024 * 1024) } } },\n+ }),\n+ ).rejects.toThrow(\"OpenAI image URL download exceeded 1 bytes\");\n+ expect(requestRelease).toHaveBeenCalledOnce();\n+ expect(downloadRelease).toHaveBeenCalledOnce();\n+ });\n+\n it(\"wraps malformed successful OpenAI image responses\", async () => {\n postJsonRequestMock.mockResolvedValue({\n response: { json: async () => ({ data: { b64_json: \"not-an-array\" } }) },\n\ndiff --git a/extensions/openai/image-generation-provider.ts b/extensions/openai/image-generation-provider.ts\nindex 4b0e64bd66c7b..f871d62a446bc 100644\n--- a/extensions/openai/image-generation-provider.ts\n+++ b/extensions/openai/image\n\n[file diff truncated: 6036 characters omitted]\n\n\n\ndiff --git a/pnpm-lock.yaml b/pnpm-lock.yaml\nindex 09f3aa93f0970..65a0f47250cf3 100644\n--- a/pnpm-lock.yaml\n+++ b/pnpm-lock.yaml\n@@ -274,6 +274,9 @@ importers:\n lit:\n specifier: 3.3.3\n version: 3.3.3\n+ node-llama-cpp:\n+ specifier: ^3.18.1\n+ version: 3.18.1(typescript@6.0.3)\n oxfmt:\n specifier: 0.52.0\n version: 0.52.0\n@@ -1942,7 +1945,7 @@ importers:\n version: 14.1.2\n '@vitest/browser-playwright':\n specifier: 4.1.7\n- version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n+ version: 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0))(vitest@4.1.7)\n jsdom:\n specifier: 29.1.1\n version: 29.1.1(@noble/hashes@2.0.1)\n@@ -1951,10 +1954,10 @@ importers:\n version: 1.60.0\n vite:\n specifier: 8.0.14\n- version: 8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)\n+ version: 8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.3)(yaml@2.9.0)\n vitest:\n specifier: 4.1.7\n- version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.2)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))\n+ version: 4.1.7(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/browser-playwright@4.1.7)(@vitest/coverage-v8@4.1.7)(jsdom@29.1.1(@noble/hashes@2.0.1))(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.1)(jiti@2\n\n[file diff truncated: 100450 characters omitted]\n\n.9.2\n- '@vitest/browser-playwright': 4.1.7(playwright@1.60.0)(vite@8.0.14(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.7)\n- '@vitest/coverage-v8': 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7)\n- jsdom: 29.1.1(@noble/hashes@2.0.1)\n- transitivePeerDependencies:\n- - msw\n-\n void-elements@3.1.0: {}\n \n vscode-jsonrpc@8.2.1: {}\n@@ -14008,7 +14073,7 @@ snapshots:\n form-data: 2.5.4\n json-bigint: 1.0.0\n pako: 2.1.0\n- semver: 7.8.2\n+ semver: 7.8.1\n spark-md5: 3.0.2\n tough-cookie: 4.1.3\n ws: 8.21.0\n\ndiff --git a/src/gateway/server-cr\n\n[file diff truncated: 799 characters omitted]\n\n\n\n[diff truncated from 173937 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535199291}} +{"type":"message","id":"b69401dc","parentId":"934af235","timestamp":"2026-06-15T14:53:26.132Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"820093563","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider download guarding, which are complex. The classification focuses on the core functional changes related to external service interaction and data handling."],"topics_of_interest":["model_serving","gateway"],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a guarded HTTP path."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7321,"output":107,"cacheRead":0,"cacheWrite":0,"totalTokens":7428,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535199303,"responseId":"chatcmpl-7ijo4p2p3a4ijhccu2raym"}} +{"type":"message","id":"47ec4204","parentId":"b69401dc","timestamp":"2026-06-15T14:53:26.134Z","message":{"role":"toolResult","toolCallId":"820093563","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider download guarding, which are complex. The classification focuses on the core functional changes related to external service interaction and data handling.\"\n ],\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a guarded HTTP path.\"\n}"}],"details":{},"isError":true,"timestamp":1781535206134}} +{"type":"message","id":"cfb9fe7e","parentId":"47ec4204","timestamp":"2026-06-15T14:53:31.083Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"290084423","name":"final_json","arguments":{"caveats":["The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider download guarding, which are complex. The classification focuses on the core functional changes related to external service interaction and data handling."],"description":"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a guarded HTTP path.","topics_of_interest":["model_serving","gateway"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7589,"output":107,"cacheRead":0,"cacheWrite":0,"totalTokens":7696,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535206135,"responseId":"chatcmpl-4aj4qvq9zu2zpdsha34uj"}} +{"type":"message","id":"2432c584","parentId":"cfb9fe7e","timestamp":"2026-06-15T14:53:31.084Z","message":{"role":"toolResult","toolCallId":"290084423","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The PR addresses multiple areas including Windows shims, image URL parsing for OpenAI-compatible responses, and provider download guarding, which are complex. The classification focuses on the core functional changes related to external service interaction and data handling.\"\n ],\n \"description\": \"This PR fixes issues with Windows QMD shims and guards image URL downloads from OpenAI-compatible providers through a guarded HTTP path.\",\n \"topics_of_interest\": [\n \"model_serving\",\n \"gateway\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535211084}} +{"type":"message","id":"84e62bf5","parentId":"2432c584","timestamp":"2026-06-15T14:53:38.834Z","message":{"role":"assistant","content":[{"type":"text","text":"<|channel>thought\nThe previous attempt failed due to the caveat length constraint. I need to shorten the caveat while keeping the core meaning and re-submit. The topics `model_serving` (for guarded HTTP/URL handling) and `gateway` (mentioned in labels and related to routing/server components) seem appropriate based on the title (\"resolve QMD Windows shims and guard image URL downloads\") and body content."},{"type":"toolCall","id":"260206863","name":"final_json","arguments":{"caveats":["PR fixes Windows QMD shims and guards external image URL downloads from OpenAI-compatible providers via guarded HTTP transport."],"description":"This PR resolves issues with Windows QMD shims and implements guarded download paths for image URLs returned by OpenAI-compatible providers.","topics_of_interest":["model_serving","gateway"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":7860,"output":169,"cacheRead":0,"cacheWrite":0,"totalTokens":8029,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535211084,"responseId":"chatcmpl-6ycfcmoave6he1zhlrued"}} +{"type":"message","id":"78518c10","parentId":"84e62bf5","timestamp":"2026-06-15T14:53:38.835Z","message":{"role":"toolResult","toolCallId":"260206863","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-bte6MP/final-output.json"},"isError":false,"timestamp":1781535218835}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/prompts/20260615T145243Z-1677863.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/prompts/20260615T145243Z-1677863.md new file mode 100644 index 0000000000000000000000000000000000000000..b7e41894c595b4e41e80a0f225d520ef719f1c39 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/prompts/20260615T145243Z-1677863.md @@ -0,0 +1,435 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#84509` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 84509 +- URL: https://github.com/openclaw/openclaw/pull/84509 +- Title: fix(acp): preserve pre-tool text in final_only delivery mode +- State: closed +- Author: Jerry-Xin +- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look +- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts + +Body (truncated): +```markdown +## Summary + +In `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user. + +**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate "final" delivery — and channels like Feishu that replace the previous card only show the last one. + +**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state: +- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled +- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn +- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls + +The turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes. + +Fixes #84486. +Also related to #84491. + +## Changes + +- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state +- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test + +## + +[body truncated: 6877 characters omitted] + + mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages +4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering "I'll run that command now." as a premature `kind="final"` delivery and clearing the buffer. The post-tool text would arrive as a second "final" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely. + +### Cleanup + +```bash +docker rm -f openclaw-test-84486 +``` + +``` + +Comments/context (truncated): +```markdown +- Jerry-Xin at 2026-05-20T08:39:06Z: +## Real behavior proof + +- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer. + +- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`. + +- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug: + +``` + āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done +AssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal [] + → On main, the projector delivers text+tools immediately on the intermediate "done" + event instead of deferring to the turn-level flush. + + āÆ src/auto-reply/reply/acp-projector.test.t + +[comments/context truncated: 20038 characters omitted] + +-> + + +- clawsweeper[bot] at 2026-05-23T02:36:03Z: +ClawSweeper applied the proposed close for this PR. + +- Action: closed this PR. +- Close reason: duplicate or superseded. +- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044). + + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts +index 78d1f9f548a2a..13adbd3f5e777 100644 +--- a/src/auto-reply/reply/acp-projector.test.ts ++++ b/src/auto-reply/reply/acp-projector.test.ts +@@ -364,6 +364,9 @@ describe("createAcpReplyProjector", () => { + expect(deliveries).toStrictEqual([]); + + await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); + expect(deliveries).toHaveLength(3); + expect(deliveries[0]).toEqual({ + kind: "tool", +@@ -769,4 +772,156 @@ describe("createAcpReplyProjector", () => { + + expect(combinedBlockText(deliveries)).toBe("AB"); + }); ++ ++ describe("final_only multi-completion accumulation", () => { ++ it("accumulates text across intermediate done events in final_only mode", async () => { ++ const { deliveries, projector } = createFinalOnlyStatusToolHarness(); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Searching...", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.onEvent({ ++ type: "text_delta", ++ text: "Results: found 3 items", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ expect(deliveries).toStrictEqual([]); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ expect(finals[0]!.text).toBe("Searching...Results: found 3 items"); ++ }); ++ ++ it("flushes text + +[file diff truncated: 3611 characters omitted] + +ent({ ++ type: "text_delta", ++ text: "After tool.", ++ tag: "agent_message_chunk", ++ }); ++ await projector.onEvent({ type: "done" }); ++ ++ await projector.flush(true); ++ const finals = deliveries.filter((d) => d.kind === "final"); ++ expect(finals).toHaveLength(1); ++ // Should contain a paragraph separator (\n\n) between the two text segments ++ expect(finals[0]!.text).toContain("Before tool."); ++ expect(finals[0]!.text).toContain("After tool."); ++ expect(finals[0]!.text).toMatch(/Before tool\.\n\nAfter tool\./); ++ }); ++ }); + }); + +diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts +index 3b919a2b3d462..e405c48707cc5 100644 +--- a/src/auto-reply/reply/acp-projector.ts ++++ b/src/auto-reply/reply/acp-projector.ts +@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: { + }, liveIdleFlushMs); + }; + +- const resetTurnState = () => { ++ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => { + clearLiveIdleTimer(); + blockReplyPipeline.stop(); + blockReplyPipeline = createTurnBlockReplyPipeline(); +- emittedOutputChars = 0; +- truncationNoticeEmitted = false; + lastStatusHash = undefined; + lastToolHash = undefined; + lastUsageTuple = undefined; +- lastVisibleOutputTail = undefined; +- pendingHiddenBoundary = false; + liveBufferText = ""; +- finalOnlyOutputText = ""; +- pendingToolDeliveries.length = 0; + toolLifecycleById.clear(); ++ if (!opts?.preserveAccumulated) { ++ emittedOutputChars = 0; ++ truncationNoticeEmitted = false; ++ lastVisibleOutputTail = undefined; ++ pendingHiddenBoundary = false; ++ finalOnlyOutputText = ""; ++ pendingToolDeliveries.length = 0; ++ } + }; + + const flushBufferedToolDeliveries = async (force: boolean) => { +@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: { + } + + if (event.type === "done" || event.type === "error") { +- await flush(true); +- resetTurnState(); ++ if (settings.deliveryMode === "final_only" && event.type === "done") { ++ // In final_only mode, skip flush on intermediate "done" events. ++ // Text keeps accumulating in finalOnlyOutputText across completions; ++ // the turn-level flush(true) in dispatch-acp.ts delivers everything. ++ resetTurnState({ preserveAccumulated: true }); ++ } else { ++ await flush(true); ++ resetTurnState(); ++ } + } + }; + + + +[diff truncated from 7810 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/schemas/20260615T145243Z-1677863.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/schemas/20260615T145243Z-1677863.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/schemas/20260615T145243Z-1677863.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-52-44-283Z_019ecbc5-477b-7737-9be7-0d693932cbbf.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-52-44-283Z_019ecbc5-477b-7737-9be7-0d693932cbbf.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..eb4085ebb4ee82a29e73947af0879e6617040619 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-52-44-283Z_019ecbc5-477b-7737-9be7-0d693932cbbf.jsonl @@ -0,0 +1,11 @@ +{"type":"session","version":3,"id":"019ecbc5-477b-7737-9be7-0d693932cbbf","timestamp":"2026-06-15T14:52:44.283Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"a32abae3","parentId":null,"timestamp":"2026-06-15T14:52:44.343Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"64c2e347","parentId":"a32abae3","timestamp":"2026-06-15T14:52:44.343Z","thinkingLevel":"off"} +{"type":"message","id":"68129389","parentId":"64c2e347","timestamp":"2026-06-15T14:52:44.349Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535164348}} +{"type":"message","id":"22ec7d2e","parentId":"68129389","timestamp":"2026-06-15T14:52:51.412Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"106832104","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior."],"topics_of_interest":["acp","tool_calling"],"description":"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6129,"output":121,"cacheRead":0,"cacheWrite":0,"totalTokens":6250,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535164360,"responseId":"chatcmpl-lxpdvke001acpop5v8aap"}} +{"type":"message","id":"8fab1489","parentId":"22ec7d2e","timestamp":"2026-06-15T14:52:51.414Z","message":{"role":"toolResult","toolCallId":"106832104","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior.\"\n ],\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ],\n \"description\": \"The PR fixes an issue where pre-tool text is lost in final_only ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state during tool use.\"\n}"}],"details":{},"isError":true,"timestamp":1781535171414}} +{"type":"message","id":"d1d0ad10","parentId":"8fab1489","timestamp":"2026-06-15T14:52:56.496Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"607272971","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior."],"description":"This change preserves pre-tool text output when using final_only delivery mode within an ACP turn that involves tool calls.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6425,"output":110,"cacheRead":0,"cacheWrite":0,"totalTokens":6535,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535171414,"responseId":"chatcmpl-5nmcpp0k7thfyqtzntqn5b"}} +{"type":"message","id":"87bbfe53","parentId":"d1d0ad10","timestamp":"2026-06-15T14:52:56.497Z","message":{"role":"toolResult","toolCallId":"607272971","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior.\"\n ],\n \"description\": \"This change preserves pre-tool text output when using final_only delivery mode within an ACP turn that involves tool calls.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535176497}} +{"type":"message","id":"984f98cb","parentId":"87bbfe53","timestamp":"2026-06-15T14:53:01.596Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"260881109","name":"final_json","arguments":{"caveats":["The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior."],"description":"This change preserves pre-tool text output when using final_only delivery mode within an ACP turn that involves tool calls.","topics_of_interest":["acp","tool_calling"]}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6702,"output":110,"cacheRead":0,"cacheWrite":0,"totalTokens":6812,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535176497,"responseId":"chatcmpl-y1sn71wez4936dvdmyrz7"}} +{"type":"message","id":"d4cf2825","parentId":"984f98cb","timestamp":"2026-06-15T14:53:01.597Z","message":{"role":"toolResult","toolCallId":"260881109","toolName":"final_json","content":[{"type":"text","text":"Validation failed for tool \"final_json\":\n - caveats.0: must not have more than 240 characters\n\nReceived arguments:\n{\n \"caveats\": [\n \"The provided context is a PR description and diff, which focuses on fixing text preservation during tool use in 'final_only' delivery mode for ACP. The classification relies heavily on the cue words present in the title and body regarding ACP protocol behavior.\"\n ],\n \"description\": \"This change preserves pre-tool text output when using final_only delivery mode within an ACP turn that involves tool calls.\",\n \"topics_of_interest\": [\n \"acp\",\n \"tool_calling\"\n ]\n}"}],"details":{},"isError":true,"timestamp":1781535181597}} +{"type":"message","id":"87e1a796","parentId":"d4cf2825","timestamp":"2026-06-15T14:53:01.878Z","message":{"role":"assistant","content":[],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6979,"output":1,"cacheRead":0,"cacheWrite":0,"totalTokens":6980,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535181598,"responseId":"chatcmpl-tiw80ekktxsfchxik2dk7a"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-53-02-686Z_019ecbc5-8f5e-75dd-a5af-9c27456a9498.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-53-02-686Z_019ecbc5-8f5e-75dd-a5af-9c27456a9498.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..1fe5ae5cc3daccee29174aa5a2e75cf0d3d9eeb0 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-84509/sessions/20260615T145243Z-1677863/2026-06-15T14-53-02-686Z_019ecbc5-8f5e-75dd-a5af-9c27456a9498.jsonl @@ -0,0 +1,5 @@ +{"type":"session","version":3,"id":"019ecbc5-8f5e-75dd-a5af-9c27456a9498","timestamp":"2026-06-15T14:53:02.686Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"ced4f473","parentId":null,"timestamp":"2026-06-15T14:53:02.704Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"4b41ee5b","parentId":"ced4f473","timestamp":"2026-06-15T14:53:02.704Z","thinkingLevel":"off"} +{"type":"message","id":"e89c2da2","parentId":"4b41ee5b","timestamp":"2026-06-15T14:53:02.710Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#84509`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 84509\n- URL: https://github.com/openclaw/openclaw/pull/84509\n- Title: fix(acp): preserve pre-tool text in final_only delivery mode\n- State: closed\n- Author: Jerry-Xin\n- Labels: size: S, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 automation, merge-risk: 🚨 message-delivery, status: šŸ‘€ ready for maintainer look\n- Changed files: src/auto-reply/reply/acp-projector.test.ts, src/auto-reply/reply/acp-projector.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nIn `final_only` delivery mode (used by Feishu, QQ Bot, and other channels that prefer a single consolidated reply), text output that precedes tool calls within the same turn is lost. Only the post-tool final response reaches the user.\n\n**Root cause**: In `acp-projector.ts`, the `onEvent` handler calls `flush(true)` + `resetTurnState()` on every `done` event, including intermediate ones (e.g. `stopReason=toolUse`). This prematurely delivers accumulated text and then clears the `finalOnlyOutputText` buffer. When the model outputs more text after tool execution, it arrives as a separate \"final\" delivery — and channels like Feishu that replace the previous card only show the last one.\n\n**Fix**: In `final_only` mode, intermediate `done` events now call `resetTurnState({ preserveAccumulated: true })`, which resets per-completion state (timers, dedup hashes, pipelines) but preserves all turn-scoped accumulated state:\n- `finalOnlyOutputText` and `pendingToolDeliveries` — the text/tool content being assembled\n- `emittedOutputChars` and `truncationNoticeEmitted` — output limit enforcement across the entire turn\n- `pendingHiddenBoundary` and `lastVisibleOutputTail` — hidden-boundary separator state for correct paragraph breaks after hidden tool calls\n\nThe turn-level `flush(true)` in `dispatch-acp.ts` delivers everything as one combined message after the entire turn completes.\n\nFixes #84486.\nAlso related to #84491.\n\n## Changes\n\n- `src/auto-reply/reply/acp-projector.ts` — Parameterized `resetTurnState()` with `preserveAccumulated` option; `final_only` + `done` now uses partial reset preserving all accumulated turn state\n- `src/auto-reply/reply/acp-projector.test.ts` — 5 new tests + 1 updated existing test\n\n## \n\n[body truncated: 6877 characters omitted]\n\n mode, **both texts were delivered as a single consolidated SSE stream** — no premature flush, no split messages\n4. **On unpatched `upstream/main`**: the intermediate `done` event after the first completion (stopReason=toolUse) would have called `flush(true)` + `resetTurnState()`, delivering \"I'll run that command now.\" as a premature `kind=\"final\"` delivery and clearing the buffer. The post-tool text would arrive as a second \"final\" delivery. Channels like Feishu that replace the previous card would only show the last message, losing the pre-tool text entirely.\n\n### Cleanup\n\n```bash\ndocker rm -f openclaw-test-84486\n```\n\n```\n\nComments/context (truncated):\n```markdown\n- Jerry-Xin at 2026-05-20T08:39:06Z:\n## Real behavior proof\n\n- **Behavior or issue addressed**: In `final_only` delivery mode, text output before tool calls within a multi-step agentic turn is lost because `flush(true)` + `resetTurnState()` fires on intermediate `done` events, prematurely delivering and then clearing the `finalOnlyOutputText` buffer.\n\n- **Real environment tested**: Local patched OpenClaw checkout at `6af59ccb95`, macOS arm64, Node.js `v24.10.0`.\n\n- **Failing proof before fix**: Applied the new test assertions to unpatched `upstream/main` projector code. Two tests fail, confirming the bug:\n\n```\n āÆ src/auto-reply/reply/acp-projector.test.ts > createAcpReplyProjector > supports deliveryMode=final_only by buffering all projected output until done\nAssertionError: expected [ { kind: 'tool', …(1) }, …(2) ] to strictly equal []\n → On main, the projector delivers text+tools immediately on the intermediate \"done\"\n event instead of deferring to the turn-level flush.\n\n āÆ src/auto-reply/reply/acp-projector.test.t\n\n[comments/context truncated: 20038 characters omitted]\n\n->\n\n\n- clawsweeper[bot] at 2026-05-23T02:36:03Z:\nClawSweeper applied the proposed close for this PR.\n\n- Action: closed this PR.\n- Close reason: duplicate or superseded.\n- Evidence: [durable ClawSweeper review](https://github.com/openclaw/openclaw/pull/84509#issuecomment-4496333044).\n\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts\nindex 78d1f9f548a2a..13adbd3f5e777 100644\n--- a/src/auto-reply/reply/acp-projector.test.ts\n+++ b/src/auto-reply/reply/acp-projector.test.ts\n@@ -364,6 +364,9 @@ describe(\"createAcpReplyProjector\", () => {\n expect(deliveries).toStrictEqual([]);\n \n await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n expect(deliveries).toHaveLength(3);\n expect(deliveries[0]).toEqual({\n kind: \"tool\",\n@@ -769,4 +772,156 @@ describe(\"createAcpReplyProjector\", () => {\n \n expect(combinedBlockText(deliveries)).toBe(\"AB\");\n });\n+\n+ describe(\"final_only multi-completion accumulation\", () => {\n+ it(\"accumulates text across intermediate done events in final_only mode\", async () => {\n+ const { deliveries, projector } = createFinalOnlyStatusToolHarness();\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Searching...\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.onEvent({\n+ type: \"text_delta\",\n+ text: \"Results: found 3 items\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+ expect(deliveries).toStrictEqual([]);\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ expect(finals[0]!.text).toBe(\"Searching...Results: found 3 items\");\n+ });\n+\n+ it(\"flushes text\n\n[file diff truncated: 3611 characters omitted]\n\nent({\n+ type: \"text_delta\",\n+ text: \"After tool.\",\n+ tag: \"agent_message_chunk\",\n+ });\n+ await projector.onEvent({ type: \"done\" });\n+\n+ await projector.flush(true);\n+ const finals = deliveries.filter((d) => d.kind === \"final\");\n+ expect(finals).toHaveLength(1);\n+ // Should contain a paragraph separator (\\n\\n) between the two text segments\n+ expect(finals[0]!.text).toContain(\"Before tool.\");\n+ expect(finals[0]!.text).toContain(\"After tool.\");\n+ expect(finals[0]!.text).toMatch(/Before tool\\.\\n\\nAfter tool\\./);\n+ });\n+ });\n });\n\ndiff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts\nindex 3b919a2b3d462..e405c48707cc5 100644\n--- a/src/auto-reply/reply/acp-projector.ts\n+++ b/src/auto-reply/reply/acp-projector.ts\n@@ -261,21 +261,23 @@ export function createAcpReplyProjector(params: {\n }, liveIdleFlushMs);\n };\n \n- const resetTurnState = () => {\n+ const resetTurnState = (opts?: { preserveAccumulated?: boolean }) => {\n clearLiveIdleTimer();\n blockReplyPipeline.stop();\n blockReplyPipeline = createTurnBlockReplyPipeline();\n- emittedOutputChars = 0;\n- truncationNoticeEmitted = false;\n lastStatusHash = undefined;\n lastToolHash = undefined;\n lastUsageTuple = undefined;\n- lastVisibleOutputTail = undefined;\n- pendingHiddenBoundary = false;\n liveBufferText = \"\";\n- finalOnlyOutputText = \"\";\n- pendingToolDeliveries.length = 0;\n toolLifecycleById.clear();\n+ if (!opts?.preserveAccumulated) {\n+ emittedOutputChars = 0;\n+ truncationNoticeEmitted = false;\n+ lastVisibleOutputTail = undefined;\n+ pendingHiddenBoundary = false;\n+ finalOnlyOutputText = \"\";\n+ pendingToolDeliveries.length = 0;\n+ }\n };\n \n const flushBufferedToolDeliveries = async (force: boolean) => {\n@@ -498,8 +500,15 @@ export function createAcpReplyProjector(params: {\n }\n \n if (event.type === \"done\" || event.type === \"error\") {\n- await flush(true);\n- resetTurnState();\n+ if (settings.deliveryMode === \"final_only\" && event.type === \"done\") {\n+ // In final_only mode, skip flush on intermediate \"done\" events.\n+ // Text keeps accumulating in finalOnlyOutputText across completions;\n+ // the turn-level flush(true) in dispatch-acp.ts delivers everything.\n+ resetTurnState({ preserveAccumulated: true });\n+ } else {\n+ await flush(true);\n+ resetTurnState();\n+ }\n }\n };\n \n\n\n[diff truncated from 7810 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`.\n\nRetry instruction: your previous response did not call the final_json tool.\n\nDo not call bash. Do not explain anything in prose, markdown, or JSON text.\n\nCall final_json exactly once with a JSON object that matches the schema."}],"timestamp":1781535182710}} +{"type":"message","id":"6f6b4910","parentId":"e89c2da2","timestamp":"2026-06-15T14:53:05.863Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\":[\"acp\",\"tool_calling\"],\"description\":\"The PR fixes an issue where pre-tool text is lost in `final_only` ACP delivery mode because intermediate 'done' events prematurely flush and reset turn state, which is corrected by preserving accumulated state during partial resets.\",\"caveats\":[]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6180,"output":67,"cacheRead":0,"cacheWrite":0,"totalTokens":6247,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535182722,"responseId":"chatcmpl-i5wb9oqtcurrb2qyeh419"}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/prompts/20260615T145338Z-1678531.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/prompts/20260615T145338Z-1678531.md new file mode 100644 index 0000000000000000000000000000000000000000..413abc9d71aab61e71bca0459b3afc6a1e0fff81 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/prompts/20260615T145338Z-1678531.md @@ -0,0 +1,396 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88504` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88504 +- URL: https://github.com/openclaw/openclaw/pull/88504 +- Title: feat(memory): add multi-slot memory role architecture +- State: open +- Author: kklouzal +- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase +- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr + +[changed files truncated: 1649 characters omitted] + +.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts + +Body (truncated): +```markdown +## Summary + +This PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector. + +What changes: + +- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`. +- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window. +- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`. +- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases. +- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins. +- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR. + +Why this matters: + +- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns. +- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin. +- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative. + +Intended outcome: + +- `memory-core` can remain the factual recall owner while other plugins own + +[body truncated: 14621 characters omitted] + +ed. +- Dev-01 `git diff --check`: passed. +- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check. +- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh. + + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-05-31T03:01:16Z: +Codex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._ + +**Summary** +The branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping. + +Reproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior. + +**Review metrics:** 1 noteworthy metric. +- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge. + +**Merge readiness** +Overall: 🐚 platinum hermit +Proof: šŸ¦ž diamond lobster +Patch quality: 🐚 platinum hermit +Result: ready for maintainer review. + +Overall follows the weake + +[comments/context truncated: 27297 characters omitted] + +s apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation. + +*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.* + +``` + +Diff/context (selected/truncated): +```diff +diff --git a/docs/cli/status.md b/docs/cli/status.md +index 3524e4ad2f047..9358aa3ec5f1e 100644 +--- a/docs/cli/status.md ++++ b/docs/cli/status.md +@@ -19,7 +19,7 @@ Notes: + + - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal). + - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`. +-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. ++- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots["memory.recall"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state. + - `--usage` prints normalized provider usage windows as `X% left`. + - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction. + - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label. + +diff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +index 4ec759c50c920..37b9e5155a91b 100644 +--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts ++++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts +@@ -147,7 +147,7 @@ describe("startQaLiveLaneGateway", () => { + + expect(cfg?.plugins?.allow).toEqual(["acpx", "qa-channel"]); + expect(cfg?.plugins?.entries).not.toHaveProperty("memory-core"); +- expect(cfg?.plugins?.slots?.memory).toBe("none"); ++ expect(cfg?.plugins?.slots?.["memory.recall"]).toBe("none"); + expect(cfg?.plugins?.slots?.contextEngine).toBe("qmd"); + expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false); + expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false); + +diff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts +index b4e55ffa63403..48afe319c8313 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.test.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.test.ts +@@ -78,7 +78,7 @@ describe("buildQaGatewayConfig", () => { + expect(cfg.models?.providers?.anthropic?.baseUrl).toBe("http://127.0.0.1:44080"); + expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true }); + expect(cfg.plugins?.allow).toEqual(["acpx", "memory-core", "qa-channel"]); +- expect(cfg.plugins?.slots?.memory).toBe("memory-core"); ++ expect(cfg.plugins?.slots?.["memory.recall"]).toBe("memory-core"); + expect(cfg.plugins?.entries?.acpx).toEqual({ + enabled: true, + config: { + +diff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts +index fb91b79ec6791..be81ada5acff5 100644 +--- a/extensions/qa-lab/src/qa-gateway-config.ts ++++ b/extensions/qa-lab/src/qa-gateway-config.ts +@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: { + plugins: { + allow: allowedPlugins, + slots: { +- memory: "memory-core", ++ "memory.recall": "memory-core", + }, + entries: { + acpx: { + +diff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts +index a61e4116ad21a..9da4552a3545e 100644 +--- a/src/commands/doctor/shared/stale-plugin-config.test.ts ++++ b/src/commands/doctor/shared/stale-plugin-config.test.ts +@@ -110,9 +110,26 @@ describe("doctor stale plugin config helpers", () => { + plugins: { + slots: { + memory: "acpx", ++ "memory.recall": "missing-recall", ++ "memory.capture": "missing-capture", ++ "memory.dreaming": "none", + contextEngine: "missing-engine", + }, + }, ++ + +[file diff truncated: 2835 characters omitted] + +e", ++ "memory.recall": "memory-core", ++ "memory.capture": "none", + contextEngine: "legacy", + }, + }, + +diff --git a/src/config/types.agents.ts b/src/c + +[file diff truncated: 1273 characters omitted] + + + +[diff truncated from 299394 characters to selected relevant excerpts] +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/schemas/20260615T145338Z-1678531.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/schemas/20260615T145338Z-1678531.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/schemas/20260615T145338Z-1678531.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531/2026-06-15T14-53-39-873Z_019ecbc6-20a1-78da-b323-bf0165daef18.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531/2026-06-15T14-53-39-873Z_019ecbc6-20a1-78da-b323-bf0165daef18.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..6e88678432f6194acdb84cbfca46cbbc0bf06363 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88504/sessions/20260615T145338Z-1678531/2026-06-15T14-53-39-873Z_019ecbc6-20a1-78da-b323-bf0165daef18.jsonl @@ -0,0 +1,6 @@ +{"type":"session","version":3,"id":"019ecbc6-20a1-78da-b323-bf0165daef18","timestamp":"2026-06-15T14:53:39.873Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"5ff8e98a","parentId":null,"timestamp":"2026-06-15T14:53:39.944Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"ca2dd4d1","parentId":"5ff8e98a","timestamp":"2026-06-15T14:53:39.944Z","thinkingLevel":"off"} +{"type":"message","id":"d1e399dd","parentId":"ca2dd4d1","timestamp":"2026-06-15T14:53:39.948Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88504`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88504\n- URL: https://github.com/openclaw/openclaw/pull/88504\n- Title: feat(memory): add multi-slot memory role architecture\n- State: open\n- Author: kklouzal\n- Labels: docs, gateway, extensions: memory-lancedb, cli, commands, agents, size: XL, extensions: qa-lab, extensions: memory-wiki, plugin: migrate-hermes, proof: supplied, proof: sufficient, P2, rating: 🐚 platinum hermit, merge-risk: 🚨 compatibility, merge-risk: 🚨 session-state, merge-risk: 🚨 availability, status: šŸ‘€ ready for maintainer look, feature: ✨ showcase\n- Changed files (truncated): docs/cli/memory.md, docs/cli/plugins.md, docs/cli/status.md, docs/concepts/active-memory.md, docs/concepts/context-engine.md, docs/gateway/configuration-reference.md, docs/plugins/manifest.md, docs/plugins/memory-lancedb.md, docs/tools/plugin.md, extensions/active-memory/index.test.ts, extensions/active-memory/index.ts, extensions/active-memory/openclaw.plugin.json, extensions/memory-lancedb/openclaw.plugin.json, extensions/memory-wiki/src/bridge.test.ts, extensions/memory-wiki/src/bridge.ts, extensions/migrate-hermes/config.ts, extensions/migrate-hermes/provider.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts, extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.ts, extensions/qa-lab/src/qa-gateway-config.test.ts, extensions/qa-lab/src/qa-gateway-config.ts, src/agents/agent-scope-config.ts, src/agents/embedded-agent-runner/compact.ts, src/agents/embedded-agent-runner/extensions.test.ts, src/agents/embedded-agent-runner/extensions.ts, src/agents/embedded-agent-runner/run/attempt.ts, src/agents/subagent-delivery-state.ts, src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry-run-manager.ts, src/agents/subagent-registry.ts, src/agents/system-prompt-config.ts, src/agents/system-prompt.ts, src/auto-reply/reply/agent-runner-memory.ts, src/cli/plugins-command-helpers.test.ts, src/cli/plugins-install-persist.test.ts, sr\n\n[changed files truncated: 1649 characters omitted]\n\n.ts, src/plugins/loader.ts, src/plugins/memory-runtime.test.ts, src/plugins/memory-runtime.ts, src/plugins/memory-state.test.ts, src/plugins/memory-state.ts, src/plugins/registry-types.ts, src/plugins/registry.ts, src/plugins/slot-resolution.ts, src/plugins/slots.test.ts, src/plugins/slots.ts, src/plugins/uninstall.test.ts, src/plugins/uninstall.ts, src/plugins/update.test.ts, src/plugins/update.ts, src/skills/loading/plugin-skills.test.ts, src/skills/loading/plugin-skills.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThis PR adds a purpose-specific memory role-slot contract so memory plugins can compose instead of replacing each other through one global `plugins.slots.memory` selector.\n\nWhat changes:\n\n- Adds canonical memory role slots: `memory.recall`, `memory.compaction`, `memory.capture`, `memory.dreaming`, and `memory.userModel`.\n- Keeps legacy `plugins.slots.memory` as a backward-compatible recall shorthand during an extended migration window.\n- Adds per-agent memory role-slot overrides under `agents.list[*].plugins.slots`, limited to memory roles plus legacy `memory`.\n- Wires role-slot selection through config schema/types/help/docs, plugin activation, gateway startup preloading, runtime memory resolution, skill publishing, validation, doctor repair/preview, uninstall cleanup, status diagnostics, and SDK-facing aliases.\n- Preserves the existing global `plugins.slots.contextEngine` path for LosslessClaw and other context-engine plugins.\n- Explicitly rejects unsupported per-agent `agents.list[*].plugins.slots.contextEngine` overrides, because agent-scoped context-engine semantics are out of scope for this PR.\n\nWhy this matters:\n\n- Advanced OpenClaw users are already operating layered memory stacks: factual recall, context compaction, auto-capture, dreaming/consolidation, and inferred user modeling are distinct concerns.\n- The previous single memory slot forced useful plugins into workarounds such as context-engine ownership, sidecars, or global replacement of the primary recall plugin.\n- This branch makes the config contract match the memory architecture users are trying to run while keeping the migration path conservative.\n\nIntended outcome:\n\n- `memory-core` can remain the factual recall owner while other plugins own\n\n[body truncated: 14621 characters omitted]\n\ned.\n- Dev-01 `git diff --check`: passed.\n- Orion/Nano-01 rollback/upgrade matrix from `v2026.5.28` to PR head `2b0d657729a38fc9b946b3a6d5ad5e39a7b85afd`: passed for release install/status/valid doctor-fix, expected old-release config rejection of future PR-era slot keys, PR install/config/status/plugins/models/agents/slots, focused runtime tests, focused doctor/legacy tests, conflict-marker check, and diff check.\n- Orion/Nano-01 live GitHub Copilot agent turn: attempted, blocked by current test-box source-runtime `github-copilot` auth absence; exact-head body proof does not claim live model-turn success for this refresh.\n\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-05-31T03:01:16Z:\nCodex review: needs maintainer review before merge. _Reviewed June 4, 2026, 12:14 AM ET / 04:14 UTC._\n\n**Summary**\nThe branch adds memory role slots and per-agent memory slot overrides, then wires them through config/schema/docs, plugin activation/startup/runtime, doctor/status/uninstall/update, skill/hook loading, and gateway subagent completion bookkeeping.\n\nReproducibility: not applicable. this is a feature PR, not a bug reproduction. Source comparison shows current main only supports the single memory slot, while the PR adds new config and routing behavior.\n\n**Review metrics:** 1 noteworthy metric.\n- **Config API expansion:** 5 global memory role slots added; 6 per-agent memory slot keys accepted. These keys become public config and plugin-routing contract, so maintainers should review the taxonomy before merge.\n\n**Merge readiness**\nOverall: 🐚 platinum hermit\nProof: šŸ¦ž diamond lobster\nPatch quality: 🐚 platinum hermit\nResult: ready for maintainer review.\n\nOverall follows the weake\n\n[comments/context truncated: 27297 characters omitted]\n\ns apt. A dreaming-focused plugin that does not also have to implement recall lookups and mid-session capture will be significantly simpler to reason about and test in isolation.\n\n*Context: Running OpenClaw with a layered episodic/core memory architecture, using scheduled Dream Cycle consolidation as an external cron sub-agent.*\n\n```\n\nDiff/context (selected/truncated):\n```diff\ndiff --git a/docs/cli/status.md b/docs/cli/status.md\nindex 3524e4ad2f047..9358aa3ec5f1e 100644\n--- a/docs/cli/status.md\n+++ b/docs/cli/status.md\n@@ -19,7 +19,7 @@ Notes:\n \n - `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).\n - Plain `openclaw status` stays on the fast read-only path and marks memory as `not checked` instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector probes are left to `openclaw status --all`, `openclaw status --deep`, `openclaw security audit`, and `openclaw memory status --deep`.\n-- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots.memory`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n+- `status --json --all` reports memory details from the active memory plugin runtime selected by `plugins.slots[\"memory.recall\"]`. Custom memory plugins can leave built-in `agents.defaults.memorySearch.enabled` disabled and still report their own files, chunks, vector, and FTS state.\n - `--usage` prints normalized provider usage windows as `X% left`.\n - Session status output separates `Execution:` from `Runtime:`. `Execution` is the sandbox path (`direct`, `docker/*`), while `Runtime` tells you whether the session is using `OpenClaw Default`, `OpenAI Codex`, a CLI backend, or an ACP backend such as `codex (acp/acpx)`. See [Agent runtimes](/concepts/agent-runtimes) for the provider/model/runtime distinction.\n - MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.\n\ndiff --git a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\nindex 4ec759c50c920..37b9e5155a91b 100644\n--- a/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n+++ b/extensions/qa-lab/src/live-transports/shared/live-gateway.runtime.test.ts\n@@ -147,7 +147,7 @@ describe(\"startQaLiveLaneGateway\", () => {\n \n expect(cfg?.plugins?.allow).toEqual([\"acpx\", \"qa-channel\"]);\n expect(cfg?.plugins?.entries).not.toHaveProperty(\"memory-core\");\n- expect(cfg?.plugins?.slots?.memory).toBe(\"none\");\n+ expect(cfg?.plugins?.slots?.[\"memory.recall\"]).toBe(\"none\");\n expect(cfg?.plugins?.slots?.contextEngine).toBe(\"qmd\");\n expect(cfg?.agents?.defaults?.memorySearch?.enabled).toBe(false);\n expect(cfg?.agents?.defaults?.memorySearch?.sync?.onSearch).toBe(false);\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.test.ts b/extensions/qa-lab/src/qa-gateway-config.test.ts\nindex b4e55ffa63403..48afe319c8313 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.test.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.test.ts\n@@ -78,7 +78,7 @@ describe(\"buildQaGatewayConfig\", () => {\n expect(cfg.models?.providers?.anthropic?.baseUrl).toBe(\"http://127.0.0.1:44080\");\n expect(cfg.models?.providers?.anthropic?.request).toEqual({ allowPrivateNetwork: true });\n expect(cfg.plugins?.allow).toEqual([\"acpx\", \"memory-core\", \"qa-channel\"]);\n- expect(cfg.plugins?.slots?.memory).toBe(\"memory-core\");\n+ expect(cfg.plugins?.slots?.[\"memory.recall\"]).toBe(\"memory-core\");\n expect(cfg.plugins?.entries?.acpx).toEqual({\n enabled: true,\n config: {\n\ndiff --git a/extensions/qa-lab/src/qa-gateway-config.ts b/extensions/qa-lab/src/qa-gateway-config.ts\nindex fb91b79ec6791..be81ada5acff5 100644\n--- a/extensions/qa-lab/src/qa-gateway-config.ts\n+++ b/extensions/qa-lab/src/qa-gateway-config.ts\n@@ -129,7 +129,7 @@ export function buildQaGatewayConfig(params: {\n plugins: {\n allow: allowedPlugins,\n slots: {\n- memory: \"memory-core\",\n+ \"memory.recall\": \"memory-core\",\n },\n entries: {\n acpx: {\n\ndiff --git a/src/commands/doctor/shared/stale-plugin-config.test.ts b/src/commands/doctor/shared/stale-plugin-config.test.ts\nindex a61e4116ad21a..9da4552a3545e 100644\n--- a/src/commands/doctor/shared/stale-plugin-config.test.ts\n+++ b/src/commands/doctor/shared/stale-plugin-config.test.ts\n@@ -110,9 +110,26 @@ describe(\"doctor stale plugin config helpers\", () => {\n plugins: {\n slots: {\n memory: \"acpx\",\n+ \"memory.recall\": \"missing-recall\",\n+ \"memory.capture\": \"missing-capture\",\n+ \"memory.dreaming\": \"none\",\n contextEngine: \"missing-engine\",\n },\n },\n+ \n\n[file diff truncated: 2835 characters omitted]\n\ne\",\n+ \"memory.recall\": \"memory-core\",\n+ \"memory.capture\": \"none\",\n contextEngine: \"legacy\",\n },\n },\n\ndiff --git a/src/config/types.agents.ts b/src/c\n\n[file diff truncated: 1273 characters omitted]\n\n\n\n[diff truncated from 299394 characters to selected relevant excerpts]\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535219947}} +{"type":"message","id":"fd825126","parentId":"d1e399dd","timestamp":"2026-06-15T14:53:46.011Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"286723015","name":"final_json","arguments":{"caveats":["The provided context is heavily truncated, but the title and body clearly indicate a change to memory role-slot architecture."],"topics_of_interest":["memory","config"],"description":"This PR introduces canonical memory role slots (e.g., `memory.recall`) to allow memory plugins to compose instead of replacing each other via a single global slot configuration."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":6894,"output":92,"cacheRead":0,"cacheWrite":0,"totalTokens":6986,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535219960,"responseId":"chatcmpl-9l8nwjqpcotwfesjxl7dk"}} +{"type":"message","id":"6a0d6bae","parentId":"fd825126","timestamp":"2026-06-15T14:53:46.013Z","message":{"role":"toolResult","toolCallId":"286723015","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-83f0Yg/final-output.json"},"isError":false,"timestamp":1781535226013}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/prompts/20260615T145346Z-1678652.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/prompts/20260615T145346Z-1678652.md new file mode 100644 index 0000000000000000000000000000000000000000..a1881ca6abf20ab542e26ea9f99e751ffba9f33c --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/prompts/20260615T145346Z-1678652.md @@ -0,0 +1,296 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#88875` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 88875 +- URL: https://github.com/openclaw/openclaw/pull/88875 +- Title: docs: document markdown and shared helpers +- State: open +- Author: steipete +- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof +- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru + +[changed files truncated: 2181 characters omitted] + +els/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts +- Context caveats: diff unavailable: github returned status 406 + +Body: +```markdown +## Summary + +- Continue the post-#88554 inline-comment pass on a fresh PR branch. +- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts. +- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior. +- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`. + +## Verification + +Behavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts. +Real environment tested: local macOS source checkout. +Exact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`. +Evidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards. +Observed result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`. +What was not tested: full repository checks were not run because this slice only adds API comments. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-01T02:36:12Z: +Codex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._ + +**Summary** +The PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors. + +Reproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead. + +**Review metrics:** none identified. + +**Stored data model** +Persistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge. + +**Merge readiness** +Overall: šŸ§‚ unranked krab +Proof: šŸ§‚ unranked krab +Patch quality: 🦪 silver shellfish +Result: blocked until real behavior proof is added. + + + +[comments/context truncated: 10678 characters omitted] + +x ci`, or `@clawsweeper address review`. +- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation. + + + + + + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/schemas/20260615T145346Z-1678652.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/schemas/20260615T145346Z-1678652.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/schemas/20260615T145346Z-1678652.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652/2026-06-15T14-53-47-171Z_019ecbc6-3d23-756b-af7a-62331b12490f.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652/2026-06-15T14-53-47-171Z_019ecbc6-3d23-756b-af7a-62331b12490f.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..c6171686f354315ab0fa3061d8df4d9d2dd92ff4 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-88875/sessions/20260615T145346Z-1678652/2026-06-15T14-53-47-171Z_019ecbc6-3d23-756b-af7a-62331b12490f.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc6-3d23-756b-af7a-62331b12490f","timestamp":"2026-06-15T14:53:47.171Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"de7aea88","parentId":null,"timestamp":"2026-06-15T14:53:47.235Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"f839f32c","parentId":"de7aea88","timestamp":"2026-06-15T14:53:47.235Z","thinkingLevel":"off"} +{"type":"message","id":"e5992a8b","parentId":"f839f32c","timestamp":"2026-06-15T14:53:47.241Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#88875`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 88875\n- URL: https://github.com/openclaw/openclaw/pull/88875\n- Title: docs: document markdown and shared helpers\n- State: open\n- Author: steipete\n- Labels: app: web-ui, gateway, cli, commands, agents, maintainer, size: XL, P3, rating: šŸ§‚ unranked krab, status: šŸ“£ needs proof\n- Changed files (truncated): packages/gateway-client/src/client.ts, packages/gateway-client/src/device-auth.ts, packages/gateway-client/src/event-loop-ready.ts, packages/gateway-client/src/readiness.ts, packages/gateway-client/src/timeouts.ts, packages/markdown-core/src/code-spans.ts, packages/markdown-core/src/ir.ts, packages/markdown-core/src/render.ts, packages/markdown-core/src/tables.ts, packages/markdown-core/src/types.ts, packages/normalization-core/src/number-coercion.ts, src/agents/agent-delete-safety.ts, src/agents/cli-session.ts, src/agents/provider-stream.ts, src/channels/account-snapshot-fields.ts, src/channels/ack-reactions.ts, src/channels/allow-from.ts, src/channels/allowlist-match.ts, src/channels/allowlists/resolve-utils.ts, src/channels/channel-config.ts, src/channels/command-gating.ts, src/channels/config-presence.ts, src/channels/conversation-label.ts, src/channels/conversation-resolution.ts, src/channels/direct-dm-access.ts, src/channels/direct-dm-guard-policy.ts, src/channels/draft-stream-loop.ts, src/channels/inbound-debounce-policy.ts, src/channels/inbound-event/context.ts, src/channels/logging.ts, src/channels/mention-gating.ts, src/channels/mention-pattern-policy.ts, src/channels/message-access/allowlist.ts, src/channels/message-access/decision.ts, src/channels/message-access/runtime-access-groups.ts, src/channels/message-access/runtime-identity.ts, src/channels/message-access/ru\n\n[changed files truncated: 2181 characters omitted]\n\nels/plugins/directory-types.ts, src/channels/plugins/dm-access.ts, src/channels/plugins/doctor-contract-api.ts, src/channels/plugins/exec-approval-local.ts, src/channels/plugins/exposure.ts, src/channels/plugins/gateway-auth-bypass.ts, src/channels/plugins/group-policy-warnings.ts, src/channels/plugins/helpers.ts, src/channels/plugins/legacy-config.ts, src/channels/plugins/media-limits.ts, src/channels/plugins/media-payload.ts, src/channels/plugins/message-action-discovery.ts\n- Context caveats: diff unavailable: github returned status 406\n\nBody:\n```markdown\n## Summary\n\n- Continue the post-#88554 inline-comment pass on a fresh PR branch.\n- Add public/API docs and invariant notes for markdown, shared helper, channel, gateway, plugin SDK, logging, restart, update, install, port-probe, PATH, JSON byte, secure-random, WebSocket, runtime status, package.json, git-root, binary detection, port diagnostics, lsof resolver, duration formatter, offsetless datetime parser, command-carrier, approval-handler runtime, CLI root-option helper, CLI argv helper, CLI invocation/display helper, CLI command policy, CLI completion helper, CLI banner helper, CLI utility helper, config set helper, CLI startup/runtime helper, and daemon shared helper contracts.\n- Keep comments out of file headers and import blocks; focus comments on exported/reused APIs and tricky behavior.\n- Latest slice documents daemon install/status/env/port/listener/probe/hint helpers in `src/cli/daemon-cli/shared.ts`.\n\n## Verification\n\nBehavior addressed: comment-only maintainability pass for helper/API contracts; latest slice covers daemon shared helper contracts.\nReal environment tested: local macOS source checkout.\nExact steps or command run after this patch: `git diff --check`; `pnpm test src/cli/daemon-cli/shared.test.ts src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts src/cli/daemon-cli/lifecycle.test.ts src/cli/daemon-cli/install.test.ts`.\nEvidence after fix: latest pushed commit `c535f6d3f35` documents daemon shared helper contracts; whitespace check passed; targeted daemon shared/status/install tests passed locally with 90 tests across 2 Vitest shards.\nObserved result after fix: follow-up PR branch is pushed at `c535f6d3f35` on `codex/markdown-render-comments`.\nWhat was not tested: full repository checks were not run because this slice only adds API comments.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-01T02:36:12Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 14, 2026, 12:50 AM ET / 04:50 UTC._\n\n**Summary**\nThe PR adds JSDoc and inline invariant comments across markdown, gateway/client, channel, plugin SDK, CLI, task, trajectory, infra, and shared helper source files, with a few formatter-shaped refactors.\n\nReproducibility: not applicable. this is source comment cleanup, not a bug report with failing current-main behavior. I verified live PR metadata, current CI, sampled patches, and current-main source instead.\n\n**Review metrics:** none identified.\n\n**Stored data model**\nPersistent data-model change detected: `unknown-data-model-change: src/shared/session-types.ts`, `unknown-data-model-change: src/trajectory/metadata.ts`, `unknown-truncated-pull-files`. Confirm migration or upgrade compatibility proof before merge.\n\n**Merge readiness**\nOverall: šŸ§‚ unranked krab\nProof: šŸ§‚ unranked krab\nPatch quality: 🦪 silver shellfish\nResult: blocked until real behavior proof is added.\n\n\n\n[comments/context truncated: 10678 characters omitted]\n\nx ci`, or `@clawsweeper address review`.\n- Maintainers can comment `@clawsweeper explain` to ask for more context, or `@clawsweeper stop` to stop active automation.\n\n\n\n\n\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535227241}} +{"type":"message","id":"8115e390","parentId":"e5992a8b","timestamp":"2026-06-15T14:53:51.896Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"docs\"], \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, CLI, and other contracts with JSDoc and inline invariant comments.\", \"caveats\": [\"The full context of the changes is truncated, but the title and body clearly indicate documentation work.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5138,"output":71,"cacheRead":0,"cacheWrite":0,"totalTokens":5209,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535227256,"responseId":"chatcmpl-0z7615rypmrg2xhf7wjdpoa"}} +{"type":"message","id":"5a60fff7","parentId":"8115e390","timestamp":"2026-06-15T14:53:52.634Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"docs\"\n ],\n \"description\": \"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, CLI, and other contracts with JSDoc and inline invariant comments.\",\n \"caveats\": [\n \"The full context of the changes is truncated, but the title and body clearly indicate documentation work.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781535232634}} +{"type":"message","id":"911dee6e","parentId":"5a60fff7","timestamp":"2026-06-15T14:53:56.369Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"324552315","name":"final_json","arguments":{"caveats":["The full context of the changes is truncated, but the title and body clearly indicate documentation work."],"topics_of_interest":["docs"],"description":"This PR focuses on documenting markdown, shared helpers, channel, gateway, plugin SDK, CLI, and other contracts with JSDoc and inline invariant comments."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5380,"output":80,"cacheRead":0,"cacheWrite":0,"totalTokens":5460,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535232647,"responseId":"chatcmpl-2dsn7n11ldzeppwl9vj8zd"}} +{"type":"message","id":"75c2978d","parentId":"911dee6e","timestamp":"2026-06-15T14:53:56.371Z","message":{"role":"toolResult","toolCallId":"324552315","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-AxHXmN/final-output.json"},"isError":false,"timestamp":1781535236371}} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/prompts/20260615T145305Z-1678122.md b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/prompts/20260615T145305Z-1678122.md new file mode 100644 index 0000000000000000000000000000000000000000..5b0d8f1db0c469b46f0f0a9961509d73aed275d8 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/prompts/20260615T145305Z-1678122.md @@ -0,0 +1,347 @@ +# OpenClaw Routing Classifier + +Classify one OpenClaw GitHub issue or pull request for maintainer notification +routing, not code search. Return only the final structured JSON required by the +schema. No prose, markdown, analysis, or extra fields. + +Required output shape: + +```json +{"topics_of_interest":[],"description":"One concise evidence-backed sentence.","caveats":[]} +``` + +## Source-First Code Items + +For code-specific issues or pull requests, source evidence should normally be +checked before final classification when a named path, symbol, handler, +provider predicate, delivery path, or test expectation appears in the title +or first problem statement. Use only the available read-only repository +inspection capability, keep it to one small lookup, and skip it for docs-only +or clearly non-code routing items. + +## Allowed Topics + +```json +[ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" +] +``` + +Topic definitions and cue words: + +- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model +- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config +- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm +- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted +- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight +- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx +- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp +- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run +- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp +- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face +- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub +- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune +- `model_releases`: New model release tracking or version-specific model behavior. cues: model release +- `agent_demos`: Demo workflows and visible examples for agents. cues: demo +- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex +- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run +- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session +- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway +- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec +- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval +- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox +- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook +- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron +- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord +- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui +- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser +- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory +- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security +- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config +- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build +- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs +- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test +- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage +- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api +- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue +- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify +- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill +- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth +- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry +- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call + +## Decision Rules + +Choose the smallest set of topics needed to route this item to the right +maintainer interest bucket. Do not describe every technical area touched. + +Process: + +1. Identify the single main user-visible problem or feature from the title. +2. Pick the one allowed topic that best names that problem. +3. Add a second topic only if the item would be misrouted without it. +4. Delete topics that merely name implementation details, affected subsystems, + examples, validation work, or likely consequences. + +Default topic count: + +- 0 topics when no allowed topic is central. +- 1 topic for normal items. +- 2 topics only for genuinely cross-topic items. +- 3+ topics only for explicit multi-system coordination. + +Title-first centrality: + +- The title is the strongest routing evidence. +- Body, labels, files, comments, and diff can confirm the title topic or add one + essential second topic, but must not broaden the label set. +- If a candidate topic is not supported by the title or first clear problem + statement in the body, omit it. +- Treat changed files and tests as weak evidence unless they are the subject. + +Enum discipline: + +- Output only exact allowed topic ids. +- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`, + `thread`, `provider`, `tool`, or `test`. +- If the closest word in the title is not allowed, map it to the nearest + allowed topic or omit it. + +## Positive Cues + +- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status + reporting route to `telemetry_usage`. +- Subagents, coding-agent runs, harness behavior, approvals, sandboxing, + compaction, or agent orchestration route to `coding_agents`. +- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility, + local fallback, and local context behavior route to `local_models`. +- OpenAI-compatible serving, base URL normalization for model endpoints, + streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and + request routing route to `model_serving`. +- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces + route to `chat_integrations`; generic notify policy/delivery gates route to + `notifications`. +- Chat UI display/status/footer behavior routes to `ui_tui` only when the + user-facing interface is central. + +## Over-Label Guardrails + +- `api_surface`: external API, CLI, or HTTP contracts only. Not internal + payloads/options/functions, status text, UI events, or ordinary command + behavior. +- `reliability`: operational failures such as timeout, crash, leak, retry, + stuck state, data loss, cleanup, or recovery. Not a generic bug tag. +- `sessions`: session lifecycle/state/storage/identity only. Not every item + mentioning session context or files. +- `local_model_providers`: provider setup/routing/auth/discovery/compatibility + only. Not every local endpoint issue. +- `config`: configuration behavior itself, not any feature with an option. +- `docs` and `tests_ci`: only when docs or test tooling is the subject. + +## Tie-Breakers + +- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features + are `telemetry_usage`, even if shown in UI or session status. +- Base URL normalization, endpoint lifecycle/selection, streaming, request + routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model + endpoint compatibility are `model_serving`. +- TTS, shell/exec, command, tool invocation, allowlist, and execution-control + behavior are `exec_tools` when the feature controls execution or spoken/tool + output. +- Thread/session isolation, per-session binding, fallback recovery state, and + lifecycle state are `sessions` when those boundaries are central. +- Structured tool result display, stdout rendering for tool results, pre-tool + text preservation, and tool-call transcript/content handling are + `tool_calling` when tool-call semantics are central. +- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate + cleanup, and lifecycle recovery are `reliability` when recovery correctness is + central. + +## False-Positive Suppression + +- Do not use `local_model_providers` for base URL normalization, + OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming, + usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider + setup/auth/discovery/routing is central. +- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu + behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or + outbound recovery correctness. Use `chat_integrations` for named chat surfaces + and `reliability` for recovery/loss/fallback. +- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision, + generic tool output, or config-like options. +- Do not use `api_surface` for parse helpers, CLI edge-case tests, token + parsing, status/footer display, internal command behavior, or local model + compatibility. +- Do not use `config` merely because a feature adds an option. Route by what + the option controls. + +## Target + +`openclaw/openclaw#91046` + +## GitHub Context + +GitHub item: +- Repository: openclaw/openclaw +- Type: github_pr +- Number: 91046 +- URL: https://github.com/openclaw/openclaw/pull/91046 +- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520) +- State: closed +- Author: zenglingbiao +- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof +- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts + +Body (truncated): +```markdown +## Summary + +The `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== "microsoft-foundry"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520. + +## Root Cause + +In `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook. + +The exact string comparison `model.provider !== "microsoft-foundry"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests: +- `model.api` = `"openai-completions"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel) +- `model.provider` = `"microsoft-foundry-9433"` — does NOT match `"microsoft-foundry"`, so the exclusion fails +- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking` + +The fix uses `!model.provider?.startsWith("microsoft-foundry")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly. + +**Invariant violated**: The guard intended to exclude ALL + +[body truncated: 3542 characters omitted] + +undry aliases +- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior +- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling + +## Merge Risk + +Low. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests. + +``` + +Comments/context (truncated): +```markdown +- clawsweeper[bot] at 2026-06-07T01:02:10Z: +Codex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._ + +**Summary** +The PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test. + +PR surface: Source 0, Tests +20. Total +20 across 2 files. + +Reproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe. + +**Review metrics:** 1 noteworthy metric. +- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload. + +**Merge readiness** +Overall: 🦪 silver shellfish +Proof: 🦪 silver shellfish +Patch quality: 🐚 platinum hermit +Result: blocked until real behavior proof from a real setup is added. + +O + +[comments/context truncated: 11839 characters omitted] + +1c37d0006. + +That landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR. + +``` + +Diff/context: +```diff +diff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts +index 72b9830fc4791..a64b0b659f186 100644 +--- a/src/agents/embedded-agent-runner-extraparams.test.ts ++++ b/src/agents/embedded-agent-runner-extraparams.test.ts +@@ -766,6 +766,26 @@ describe("applyExtraParamsToAgent", () => { + expect(payload).not.toHaveProperty("thinking"); + }); + ++ it("does not add DeepSeek V4 thinking params on Foundry alias provider paths", () => { ++ const payload = runResponsesPayloadMutationCase({ ++ applyProvider: "microsoft-foundry-9433", ++ applyModelId: "deepseek-v4-pro", ++ thinkingLevel: "high", ++ model: { ++ api: "openai-completions", ++ provider: "microsoft-foundry-9433", ++ id: "deepseek-v4-pro", ++ } as Model<"openai-completions">, ++ payload: { ++ reasoning_effort: "high", ++ messages: [{ role: "user", content: "hello" }], ++ }, ++ }); ++ ++ expect(payload.reasoning_effort).toBe("high"); ++ expect(payload).not.toHaveProperty("thinking"); ++ }); ++ + it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => { + const payload = runResponsesPayloadMutationCase({ + applyProvider: "opencode", +diff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts +index ff97b19b22fc6..5b8f4cad9c73d 100644 +--- a/src/agents/embedded-agent-runner/extra-params.ts ++++ b/src/agents/embedded-agent-runner/extra-params.ts +@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool + const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id); + return ( + model.api === "openai-completions" && +- model.provider !== "microsoft-foundry" && ++ !model.provider?.startsWith("microsoft-foundry") && + (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") + ); + } + +``` + +Use this context as source of truth. If important sections are missing, +unavailable, selected, or truncated, classify from what is available and mention +material limits in `caveats`. diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/schemas/20260615T145305Z-1678122.json b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/schemas/20260615T145305Z-1678122.json new file mode 100644 index 0000000000000000000000000000000000000000..8063c7357c4dfd6bc6499aca100d075202e64431 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/schemas/20260615T145305Z-1678122.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "additionalProperties": false, + "required": [ + "topics_of_interest", + "description", + "caveats" + ], + "properties": { + "topics_of_interest": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "enum": [ + "local_models", + "local_model_providers", + "model_serving", + "self_hosted_inference", + "open_weight_models", + "acpx", + "acp", + "coding_agents", + "mcp_tooling", + "hf_agents", + "hub_workflows", + "post_training", + "model_releases", + "agent_demos", + "codex", + "agent_runtime", + "sessions", + "gateway", + "exec_tools", + "approvals", + "sandboxing", + "hooks", + "cron_automation", + "chat_integrations", + "ui_tui", + "browser_automation", + "memory", + "security", + "config", + "packaging_deployment", + "docs", + "tests_ci", + "telemetry_usage", + "api_surface", + "queueing", + "notifications", + "skills_plugins", + "auth_identity", + "reliability", + "tool_calling" + ] + }, + "uniqueItems": true + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "caveats": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string", + "maxLength": 240 + } + } + } +} diff --git a/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122/2026-06-15T14-53-06-903Z_019ecbc5-9fd7-7f50-b667-6e6cd1c60dcf.jsonl b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122/2026-06-15T14-53-06-903Z_019ecbc5-9fd7-7f50-b667-6e6cd1c60dcf.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..ff7d0baf9df626cb1f135d5b30a5e650d8bc48c9 --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run-20260615T145111Z/state/source-first-code-items__openclaw-openclaw-91046/sessions/20260615T145305Z-1678122/2026-06-15T14-53-06-903Z_019ecbc5-9fd7-7f50-b667-6e6cd1c60dcf.jsonl @@ -0,0 +1,8 @@ +{"type":"session","version":3,"id":"019ecbc5-9fd7-7f50-b667-6e6cd1c60dcf","timestamp":"2026-06-15T14:53:06.903Z","cwd":"/home/bob/repos/localpager/localpager-agent"} +{"type":"model_change","id":"9b562659","parentId":null,"timestamp":"2026-06-15T14:53:06.971Z","provider":"local-openai","modelId":"gemma-4-e4b-it"} +{"type":"thinking_level_change","id":"8ed1f7b1","parentId":"9b562659","timestamp":"2026-06-15T14:53:06.971Z","thinkingLevel":"off"} +{"type":"message","id":"41a6ec8d","parentId":"8ed1f7b1","timestamp":"2026-06-15T14:53:06.976Z","message":{"role":"user","content":[{"type":"text","text":"# OpenClaw Routing Classifier\n\nClassify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.\n\nRequired output shape:\n\n```json\n{\"topics_of_interest\":[],\"description\":\"One concise evidence-backed sentence.\",\"caveats\":[]}\n```\n\n## Source-First Code Items\n\nFor code-specific issues or pull requests, source evidence should normally be\nchecked before final classification when a named path, symbol, handler,\nprovider predicate, delivery path, or test expectation appears in the title\nor first problem statement. Use only the available read-only repository\ninspection capability, keep it to one small lookup, and skip it for docs-only\nor clearly non-code routing items.\n\n## Allowed Topics\n\n```json\n[\n \"local_models\",\n \"local_model_providers\",\n \"model_serving\",\n \"self_hosted_inference\",\n \"open_weight_models\",\n \"acpx\",\n \"acp\",\n \"coding_agents\",\n \"mcp_tooling\",\n \"hf_agents\",\n \"hub_workflows\",\n \"post_training\",\n \"model_releases\",\n \"agent_demos\",\n \"codex\",\n \"agent_runtime\",\n \"sessions\",\n \"gateway\",\n \"exec_tools\",\n \"approvals\",\n \"sandboxing\",\n \"hooks\",\n \"cron_automation\",\n \"chat_integrations\",\n \"ui_tui\",\n \"browser_automation\",\n \"memory\",\n \"security\",\n \"config\",\n \"packaging_deployment\",\n \"docs\",\n \"tests_ci\",\n \"telemetry_usage\",\n \"api_surface\",\n \"queueing\",\n \"notifications\",\n \"skills_plugins\",\n \"auth_identity\",\n \"reliability\",\n \"tool_calling\"\n]\n```\n\nTopic definitions and cue words:\n\n- `local_models`: Local model execution, local inference behavior, local model UX, local-only f... cues: local model\n- `local_model_providers`: Local or self-hosted model backend setup, discovery, auth, routing, and compa... cues: local provider config\n- `model_serving`: Serving protocols, streaming behavior, routing, lifecycle, and gateway behavi... cues: vllm\n- `self_hosted_inference`: Self-hosted inference systems and locally operated services, including embedd... cues: self-hosted\n- `open_weight_models`: Open-weight model families, model packaging, quantization, and local deployab... cues: open weight\n- `acpx`: ACPX protocol, transport, proxy, backend process, compatibility, and files or... cues: acpx\n- `acp`: ACP protocol features and session tools that are not necessarily ACPX-specific. cues: acp\n- `coding_agents`: General coding-agent runtime, tools, approvals, sandboxes, sessions, hooks, a... cues: agent run\n- `mcp_tooling`: MCP server or client behavior, tools/list, resources, and tool invocation com... cues: mcp\n- `hf_agents`: Hugging Face agent workflows, Spaces, Hub agent demos, or HF-specific agent i... cues: hugging face\n- `hub_workflows`: Hub automation for datasets, models, Spaces, releases, and repository synchro... cues: hub\n- `post_training`: Fine-tuning, preference optimization, evaluation loops, and data generation a... cues: fine tune\n- `model_releases`: New model release tracking or version-specific model behavior. cues: model release\n- `agent_demos`: Demo workflows and visible examples for agents. cues: demo\n- `codex`: Items that explicitly involve the Codex runtime or command compatibility. cues: codex\n- `agent_runtime`: Agent runner, harness, orchestration, subagent execution, heartbeat, and agen... cues: agent run\n- `sessions`: Session identity, persistence, binding, transcript, resume, reset, parent/chi... cues: session\n- `gateway`: OpenClaw gateway behavior, daemon startup, HTTP gateway routes, gateway resta... cues: gateway\n- `exec_tools`: Shell execution, exec tools, command allowlists, tool invocation, tool schema... cues: exec\n- `approvals`: Approval flows, permission modes, approve/deny commands, policy checks, and p... cues: approval\n- `sandboxing`: Sandbox isolation, containers, Docker, process limits, filesystem hiding, and... cues: sandbox\n- `hooks`: Hook lifecycle, hook events, hook payloads, hook filtering, and managed hook ... cues: hook\n- `cron_automation`: Cron jobs, scheduled runs, heartbeat automation, one-shot jobs, and recurring... cues: cron\n- `chat_integrations`: Chat platform integrations and delivery surfaces such as Discord, Telegram, S... cues: discord\n- `ui_tui`: Control UI, TUI, dashboard, web UI, session list, status views, and user-faci... cues: ui\n- `browser_automation`: Browser automation, screenshots, Chrome integration, browser vision, and web ... cues: browser\n- `memory`: Memory systems, embeddings, vector stores, active memory, LanceDB, and memory... cues: memory\n- `security`: Security, SSRF, credentials, secrets, token handling, auth hardening, HMAC, v... cues: security\n- `config`: Configuration files, config schema, defaults, setup/onboarding, environment v... cues: config\n- `packaging_deployment`: Build, packaging, deployment, service managers, SEA, launchd, systemd, pnpm, ... cues: build\n- `docs`: Documentation, guides, README changes, spelling, taxonomy, and explanatory co... cues: docs\n- `tests_ci`: Tests, CI, fixtures, coverage, mocks, and platform-specific test fixes. cues: test\n- `telemetry_usage`: Usage accounting, token counts, cost metadata, traces, diagnostics, status re... cues: usage\n- `api_surface`: HTTP APIs, gateway APIs, REST endpoints, webhooks, SSE, OpenResponses, chat c... cues: api\n- `queueing`: Queues, lanes, task state, follow-up queues, run ordering, locks, stuck jobs,... cues: queue\n- `notifications`: Notification policy, delivery gates, notify settings, outbound messages, anno... cues: notify\n- `skills_plugins`: Skills, plugins, plugin runtime, extensions, Superpowers, hook packs, MCP App... cues: skill\n- `auth_identity`: Authentication, identity, OAuth, device identity, profile selection, account ... cues: auth\n- `reliability`: Reliability fixes for retries, stale state, crashes, timeouts, recovery, clea... cues: retry\n- `tool_calling`: Model tool-calling behavior, tool-call deltas, tool schemas, tool result rout... cues: tool call\n\n## Decision Rules\n\nChoose the smallest set of topics needed to route this item to the right\nmaintainer interest bucket. Do not describe every technical area touched.\n\nProcess:\n\n1. Identify the single main user-visible problem or feature from the title.\n2. Pick the one allowed topic that best names that problem.\n3. Add a second topic only if the item would be misrouted without it.\n4. Delete topics that merely name implementation details, affected subsystems,\n examples, validation work, or likely consequences.\n\nDefault topic count:\n\n- 0 topics when no allowed topic is central.\n- 1 topic for normal items.\n- 2 topics only for genuinely cross-topic items.\n- 3+ topics only for explicit multi-system coordination.\n\nTitle-first centrality:\n\n- The title is the strongest routing evidence.\n- Body, labels, files, comments, and diff can confirm the title topic or add one\n essential second topic, but must not broaden the label set.\n- If a candidate topic is not supported by the title or first clear problem\n statement in the body, omit it.\n- Treat changed files and tests as weak evidence unless they are the subject.\n\nEnum discipline:\n\n- Output only exact allowed topic ids.\n- Never invent shorthand such as `cli`, `tts`, `openrouter`, `status`,\n `thread`, `provider`, `tool`, or `test`.\n- If the closest word in the title is not allowed, map it to the nearest\n allowed topic or omit it.\n\n## Positive Cues\n\n- Counts, usage, cost, tokens, metrics, diagnostics, traces, and status\n reporting route to `telemetry_usage`.\n- Subagents, coding-agent runs, harness behavior, approvals, sandboxing,\n compaction, or agent orchestration route to `coding_agents`.\n- LM Studio, Ollama, llama.cpp, GGUF, local hardware, local model compatibility,\n local fallback, and local context behavior route to `local_models`.\n- OpenAI-compatible serving, base URL normalization for model endpoints,\n streaming, usage chunks, vLLM/TGI/LocalAI serving, endpoint lifecycle, and\n request routing route to `model_serving`.\n- Named Discord, Telegram, Slack, Zulip, Feishu, webchat, or similar surfaces\n route to `chat_integrations`; generic notify policy/delivery gates route to\n `notifications`.\n- Chat UI display/status/footer behavior routes to `ui_tui` only when the\n user-facing interface is central.\n\n## Over-Label Guardrails\n\n- `api_surface`: external API, CLI, or HTTP contracts only. Not internal\n payloads/options/functions, status text, UI events, or ordinary command\n behavior.\n- `reliability`: operational failures such as timeout, crash, leak, retry,\n stuck state, data loss, cleanup, or recovery. Not a generic bug tag.\n- `sessions`: session lifecycle/state/storage/identity only. Not every item\n mentioning session context or files.\n- `local_model_providers`: provider setup/routing/auth/discovery/compatibility\n only. Not every local endpoint issue.\n- `config`: configuration behavior itself, not any feature with an option.\n- `docs` and `tests_ci`: only when docs or test tooling is the subject.\n\n## Tie-Breakers\n\n- Count/usage/token/cost/metric/trace/diagnostic/status/footer-count features\n are `telemetry_usage`, even if shown in UI or session status.\n- Base URL normalization, endpoint lifecycle/selection, streaming, request\n routing, OpenAI-compatible serving, vLLM/TGI/LocalAI behavior, and model\n endpoint compatibility are `model_serving`.\n- TTS, shell/exec, command, tool invocation, allowlist, and execution-control\n behavior are `exec_tools` when the feature controls execution or spoken/tool\n output.\n- Thread/session isolation, per-session binding, fallback recovery state, and\n lifecycle state are `sessions` when those boundaries are central.\n- Structured tool result display, stdout rendering for tool results, pre-tool\n text preservation, and tool-call transcript/content handling are\n `tool_calling` when tool-call semantics are central.\n- Delivery fallback, outbound recovery, lost final/pre-tool text, duplicate\n cleanup, and lifecycle recovery are `reliability` when recovery correctness is\n central.\n\n## False-Positive Suppression\n\n- Do not use `local_model_providers` for base URL normalization,\n OpenRouter/OpenAI-compatible endpoint fixes, endpoint lifecycle, streaming,\n usage chunks, or vLLM/TGI/LocalAI serving. Use `model_serving` unless provider\n setup/auth/discovery/routing is central.\n- Do not use `notifications` for named Discord/Telegram/Slack/Zulip/Feishu\n behavior, ACP final/pre-tool text preservation, delivery fallback recovery, or\n outbound recovery correctness. Use `chat_integrations` for named chat surfaces\n and `reliability` for recovery/loss/fallback.\n- Do not use `tool_calling` for TTS tags/options, browser screenshot/vision,\n generic tool output, or config-like options.\n- Do not use `api_surface` for parse helpers, CLI edge-case tests, token\n parsing, status/footer display, internal command behavior, or local model\n compatibility.\n- Do not use `config` merely because a feature adds an option. Route by what\n the option controls.\n\n## Target\n\n`openclaw/openclaw#91046`\n\n## GitHub Context\n\nGitHub item:\n- Repository: openclaw/openclaw\n- Type: github_pr\n- Number: 91046\n- URL: https://github.com/openclaw/openclaw/pull/91046\n- Title: fix(microsoft-foundry): exclude alias providers from DeepSeek V4 thinking wrapper (fixes #90520)\n- State: closed\n- Author: zenglingbiao\n- Labels: agents, size: XS, proof: supplied, P1, rating: 🦪 silver shellfish, merge-risk: 🚨 auth-provider, status: šŸ“£ needs proof\n- Changed files: src/agents/embedded-agent-runner-extraparams.test.ts, src/agents/embedded-agent-runner/extra-params.ts\n\nBody (truncated):\n```markdown\n## Summary\n\nThe `isDeepSeekV4OpenAICompatibleModel` guard used an exact provider-id match (`model.provider !== \"microsoft-foundry\"`) to skip Foundry providers that handle thinking via their own `normalizeResolvedModel` hook. Alias providers (e.g. `microsoft-foundry-9433`) did not match the exact check, causing the shared DeepSeek V4 thinking wrapper to inject a `thinking` field that the Foundry API rejects with HTTP 400. This PR switches the check to a prefix match (`startsWith`) so all `microsoft-foundry*` variant providers are excluded. Fixes #90520.\n\n## Root Cause\n\nIn `src/agents/embedded-agent-runner/extra-params.ts`, `isDeepSeekV4OpenAICompatibleModel` is the predicate that gates `createDeepSeekV4OpenAICompatibleThinkingWrapper`. It checks that the model's API is `openai-completions` and the provider is NOT `microsoft-foundry` — because the microsoft-foundry plugin already suppresses DeepSeek V4 thinking via its own `normalizeResolvedModel` hook.\n\nThe exact string comparison `model.provider !== \"microsoft-foundry\"` fails to catch alias providers like `microsoft-foundry-9433`. When those aliases route DeepSeek V4 Pro requests:\n- `model.api` = `\"openai-completions\"` āœ“ (alias providers may not go through the plugin's normalizeResolvedModel)\n- `model.provider` = `\"microsoft-foundry-9433\"` — does NOT match `\"microsoft-foundry\"`, so the exclusion fails\n- Result: the wrapper injects a top-level `thinking` property → Foundry API returns `400 Unrecognized request argument supplied: thinking`\n\nThe fix uses `!model.provider?.startsWith(\"microsoft-foundry\")` which handles all alias variants (e.g. `microsoft-foundry-9433`, `microsoft-foundry-ai`, etc.) correctly.\n\n**Invariant violated**: The guard intended to exclude ALL\n\n[body truncated: 3542 characters omitted]\n\nundry aliases\n- Related: `pnpm test src/plugin-sdk/provider-stream-shared.test.ts` — tests the `createDeepSeekV4OpenAICompatibleThinkingWrapper` behavior\n- In CI: the full `pnpm test` suite will catch any regressions in provider parameter handling\n\n## Merge Risk\n\nLow. Single-line change from exact match to prefix match in a predicate function. The `startsWith` check is strictly broader than the original exact comparison — all existing exclusions are preserved, and new ones are added for alias variants. Both the legacy case (`microsoft-foundry`) and the new case (`microsoft-foundry-9433`) are covered by explicit tests.\n\n```\n\nComments/context (truncated):\n```markdown\n- clawsweeper[bot] at 2026-06-07T01:02:10Z:\nCodex review: needs real behavior proof before merge. _Reviewed June 6, 2026, 9:09 PM ET / 01:09 UTC._\n\n**Summary**\nThe PR broadens the DeepSeek V4 OpenAI-compatible thinking wrapper's Microsoft Foundry exclusion to Foundry-prefixed alias providers and adds an alias regression test.\n\nPR surface: Source 0, Tests +20. Total +20 across 2 files.\n\nReproducibility: yes. from source inspection plus the linked issue's A/B proof: current main and v2026.6.1 only exclude literal `microsoft-foundry`, so `microsoft-foundry-9433` can still receive the rejected `thinking` payload. I did not run the live Azure Foundry probe.\n\n**Review metrics:** 1 noteworthy metric.\n- **Provider payload gate:** 1 predicate broadened. This single runtime gate decides which provider ids receive the DeepSeek V4 top-level `thinking` payload.\n\n**Merge readiness**\nOverall: 🦪 silver shellfish\nProof: 🦪 silver shellfish\nPatch quality: 🐚 platinum hermit\nResult: blocked until real behavior proof from a real setup is added.\n\nO\n\n[comments/context truncated: 11839 characters omitted]\n\n1c37d0006.\n\nThat landed fix treats `microsoft-foundry-*` aliases as Foundry-compatible, suppresses the DeepSeek-native `thinking` fallback on those routes, and strips replayed DeepSeek reasoning fields while preserving native DeepSeek and non-native reasoning controls. Issue #90520 is closed, so I’m closing this duplicate PR.\n\n```\n\nDiff/context:\n```diff\ndiff --git a/src/agents/embedded-agent-runner-extraparams.test.ts b/src/agents/embedded-agent-runner-extraparams.test.ts\nindex 72b9830fc4791..a64b0b659f186 100644\n--- a/src/agents/embedded-agent-runner-extraparams.test.ts\n+++ b/src/agents/embedded-agent-runner-extraparams.test.ts\n@@ -766,6 +766,26 @@ describe(\"applyExtraParamsToAgent\", () => {\n expect(payload).not.toHaveProperty(\"thinking\");\n });\n \n+ it(\"does not add DeepSeek V4 thinking params on Foundry alias provider paths\", () => {\n+ const payload = runResponsesPayloadMutationCase({\n+ applyProvider: \"microsoft-foundry-9433\",\n+ applyModelId: \"deepseek-v4-pro\",\n+ thinkingLevel: \"high\",\n+ model: {\n+ api: \"openai-completions\",\n+ provider: \"microsoft-foundry-9433\",\n+ id: \"deepseek-v4-pro\",\n+ } as Model<\"openai-completions\">,\n+ payload: {\n+ reasoning_effort: \"high\",\n+ messages: [{ role: \"user\", content: \"hello\" }],\n+ },\n+ });\n+\n+ expect(payload.reasoning_effort).toBe(\"high\");\n+ expect(payload).not.toHaveProperty(\"thinking\");\n+ });\n+\n it(\"fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models\", () => {\n const payload = runResponsesPayloadMutationCase({\n applyProvider: \"opencode\",\ndiff --git a/src/agents/embedded-agent-runner/extra-params.ts b/src/agents/embedded-agent-runner/extra-params.ts\nindex ff97b19b22fc6..5b8f4cad9c73d 100644\n--- a/src/agents/embedded-agent-runner/extra-params.ts\n+++ b/src/agents/embedded-agent-runner/extra-params.ts\n@@ -923,7 +923,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters[0]): bool\n const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);\n return (\n model.api === \"openai-completions\" &&\n- model.provider !== \"microsoft-foundry\" &&\n+ !model.provider?.startsWith(\"microsoft-foundry\") &&\n (normalizedModelId === \"deepseek-v4-flash\" || normalizedModelId === \"deepseek-v4-pro\")\n );\n }\n\n```\n\nUse this context as source of truth. If important sections are missing,\nunavailable, selected, or truncated, classify from what is available and mention\nmaterial limits in `caveats`."}],"timestamp":1781535186975}} +{"type":"message","id":"854a2030","parentId":"41a6ec8d","timestamp":"2026-06-15T14:53:12.608Z","message":{"role":"assistant","content":[{"type":"text","text":"{\"topics_of_interest\": [\"coding_agents\", \"local_model_providers\"], \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\", \"caveats\": [\"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model providers.\"]}"}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5373,"output":93,"cacheRead":0,"cacheWrite":0,"totalTokens":5466,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1781535186992,"responseId":"chatcmpl-9921n58q5pj5i9x5i16fsn"}} +{"type":"message","id":"3918ac74","parentId":"854a2030","timestamp":"2026-06-15T14:53:13.355Z","message":{"role":"user","content":[{"type":"text","text":"You already completed this same localpager-agent run, but your previous answer wrote a pseudo final_json call as text.\n\nNow call the real final_json tool exactly once with this exact JSON object:\n\n{\n \"topics_of_interest\": [\n \"coding_agents\",\n \"local_model_providers\"\n ],\n \"description\": \"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match.\",\n \"caveats\": [\n \"The classification is based on the title and body, which detail changes in agent parameter handling related to specific model providers.\"\n ]\n}\n\nDo not call bash. Do not write prose, markdown, or JSON text. The only valid response is the final_json tool call."}],"timestamp":1781535193355}} +{"type":"message","id":"c3128d4a","parentId":"3918ac74","timestamp":"2026-06-15T14:53:18.090Z","message":{"role":"assistant","content":[{"type":"toolCall","id":"843258381","name":"final_json","arguments":{"caveats":["The classification is based on the title and body, which detail changes in agent parameter handling related to specific model providers."],"topics_of_interest":["coding_agents","local_model_providers"],"description":"This PR fixes an issue where alias providers for Microsoft Foundry incorrectly caused the DeepSeek V4 thinking wrapper to inject a rejected 'thinking' field by changing an exact provider ID match to a prefix match."}}],"api":"openai-completions","provider":"local-openai","model":"gemma-4-e4b-it","usage":{"input":5661,"output":103,"cacheRead":0,"cacheWrite":0,"totalTokens":5764,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1781535193371,"responseId":"chatcmpl-d3jai5av5aphtere9triq"}} +{"type":"message","id":"b26a93ed","parentId":"c3128d4a","timestamp":"2026-06-15T14:53:18.092Z","message":{"role":"toolResult","toolCallId":"843258381","toolName":"final_json","content":[{"type":"text","text":"Structured final answer captured."}],"details":{"outputPath":"/home/bob/repos/scratch/experiments/reposhell-prompt-propensity/run-20260615T145111Z/agent-state/structured-output/run-dTQszi/final-output.json"},"isError":false,"timestamp":1781535198092}} diff --git a/experiments/reposhell-prompt-propensity/run_experiment.mjs b/experiments/reposhell-prompt-propensity/run_experiment.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5f485673096bf08c1c90ba72b6925123b4789bce --- /dev/null +++ b/experiments/reposhell-prompt-propensity/run_experiment.mjs @@ -0,0 +1,447 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs"; +import path from "node:path"; + +const scratchRoot = path.resolve(import.meta.dirname, "../.."); +const localpagerRoot = "/home/bob/repos/localpager"; +const configPath = "/home/bob/.config/localpager/config.json"; +const basePromptPath = "/home/bob/.config/localpager/openclaw.prompt.md"; +const taxonomyPath = path.join(localpagerRoot, "examples/profiles/openclaw-routing-topics.json"); +const schemaPath = path.join(localpagerRoot, "schemas/classification.schema.json"); +const classifierPath = path.join(localpagerRoot, "scripts/localpager-classifier"); +const localpagerBin = path.join(localpagerRoot, "bin/localpager"); +const reposhellSocket = "/home/bob/.local/state/localpager/reposhell.sock"; + +const timestamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z"); +const outDir = path.join(scratchRoot, "experiments/reposhell-prompt-propensity", `run-${timestamp}`); +const contextsDir = path.join(outDir, "contexts"); +const promptsDir = path.join(outDir, "prompts"); +const logsDir = path.join(outDir, "logs"); +const stateDir = path.join(outDir, "state"); +for (const dir of [outDir, contextsDir, promptsDir, logsDir, stateDir]) { + mkdirSync(dir, { recursive: true }); +} + +const targets = [ + "openclaw/openclaw#84509", + "openclaw/openclaw#91046", + "openclaw/openclaw#81443", + "openclaw/openclaw#88504", + "openclaw/openclaw#88875", + "openclaw/openclaw#52126" +]; + +const evidenceLight = [ + "## Evidence Discipline", + "", + "GitHub context is primary. When the title or body names a specific file,", + "function, provider rule, event, wrapper, or delivery path and the supplied", + "context leaves the central routing topic ambiguous, ground the classification", + "in the smallest available repository evidence. Treat labels and changed-file", + "lists as hints, not proof. If source evidence would not change the topic,", + "answer directly.", + "" +].join("\n"); + +const evidenceFrontloaded = [ + "## Source Grounding Check", + "", + "Before choosing topics, decide whether the item is about a named runtime path,", + "handler, wrapper, projection, provider predicate, or test expectation. For", + "those code-specific items, resolve only enough repository evidence to identify", + "the central behavior when the GitHub excerpt is partial or ambiguous. Keep the", + "inspection narrow and ignore implementation details that do not affect routing.", + "" +].join("\n"); + +const truncationAware = [ + "## Truncation And Evidence", + "", + "When the GitHub context says body, comments, file lists, or diffs were", + "truncated, avoid relying on broad labels alone. Prefer the nearest primary", + "repository evidence for the named file, function, or behavior if that evidence", + "could change the selected topic. If the available context already identifies", + "the maintainer bucket, continue without extra inspection.", + "" +].join("\n"); + +const toolAwareOptional = [ + "## Repository Evidence Availability", + "", + "A narrow read-only repository inspection capability may be available during", + "this run. It is appropriate for code-specific routing only: named files,", + "functions, handlers, provider predicates, delivery paths, tests, or config", + "keys where the supplied GitHub excerpt does not settle the maintainer bucket.", + "Keep any inspection to the smallest relevant lookup and ignore extra", + "implementation details. Do not inspect for docs-only or clearly classified", + "items.", + "" +].join("\n"); + +const oneLookupBudget = [ + "## Code-Specific Evidence Budget", + "", + "For code-specific PRs with truncated or selected context, spend at most one", + "focused repository lookup to confirm the named behavior before final", + "classification when that confirmation can distinguish `acp`, `tool_calling`,", + "`model_serving`, `api_surface`, `reliability`, `config`, or `tests_ci`. If the", + "title and body already settle the topic, skip the lookup.", + "" +].join("\n"); + +const sourceMetadataSplit = [ + "## Metadata Versus Source Evidence", + "", + "Use the GitHub context as source of truth for item metadata: target, title,", + "body, comments, labels, and changed files. For code semantics, a small amount", + "of primary repository evidence can be stronger than labels or changed-file", + "lists when the excerpt is truncated or ambiguous. Keep any source grounding", + "narrowly tied to the named behavior.", + "" +].join("\n"); + +const sourceFirstCodeItems = [ + "## Source-First Code Items", + "", + "For code-specific issues or pull requests, source evidence should normally be", + "checked before final classification when a named path, symbol, handler,", + "provider predicate, delivery path, or test expectation appears in the title", + "or first problem statement. Use only the available read-only repository", + "inspection capability, keep it to one small lookup, and skip it for docs-only", + "or clearly non-code routing items.", + "" +].join("\n"); + +const finalAfterEvidence = [ + "## Evidence Before Final Output", + "", + "Do not rush to the final structured output for code-specific routing. First,", + "decide whether one narrow read-only repository lookup would materially reduce", + "topic ambiguity. If yes, inspect the named source area, then call the final", + "structured output. If no, answer directly from the supplied GitHub context.", + "" +].join("\n"); + +const variants = [ + { name: "baseline", insert: "" }, + { name: "source-first-code-items", insert: sourceFirstCodeItems }, + { name: "final-after-evidence", insert: finalAfterEvidence } +]; + +const basePrompt = readFileSync(basePromptPath, "utf8"); +const insertionPoint = "## Allowed Topics\n"; +for (const variant of variants) { + let prompt = basePrompt; + if (variant.introReplacement) { + prompt = prompt.replace( + "Classify one OpenClaw GitHub issue or pull request for maintainer notification\nrouting, not code search. Return only the final structured JSON required by the\nschema. No prose, markdown, analysis, or extra fields.", + variant.introReplacement + ); + } + if (variant.insert !== "") { + prompt = prompt.replace(insertionPoint, `${variant.insert}\n${insertionPoint}`); + } + writeFileSync(path.join(promptsDir, `${variant.name}.prompt.md`), prompt); +} + +function slug(value) { + return value.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-|-$/g, "").toLowerCase(); +} + +function run(command, args, options = {}) { + return spawnSync(command, args, { + encoding: "utf8", + maxBuffer: 50 * 1024 * 1024, + ...options + }); +} + +function extractPath(stderr, label) { + const match = stderr.match(new RegExp(`^${label}: (.+)$`, "m")); + return match?.[1]?.trim() ?? ""; +} + +function parseSession(sessionDir) { + const result = { + session_dir: sessionDir, + session_files: [], + bash_calls: 0, + successful_bash_calls: 0, + failed_bash_calls: 0, + final_json_calls: 0, + models: [], + commands: [] + }; + if (!sessionDir) return result; + let files = []; + try { + files = readdirSync(sessionDir).filter((file) => file.endsWith(".jsonl")).sort(); + } catch { + return result; + } + result.session_files = files.map((file) => path.join(sessionDir, file)); + const models = new Set(); + for (const file of result.session_files) { + const lines = readFileSync(file, "utf8").split(/\r?\n/).filter(Boolean); + const pendingBash = new Set(); + for (const line of lines) { + let record; + try { + record = JSON.parse(line); + } catch { + continue; + } + if (typeof record.modelId === "string") models.add(record.modelId); + if (typeof record.message?.model === "string") models.add(record.message.model); + const message = record.message; + if (!message || !Array.isArray(message.content)) continue; + for (const part of message.content) { + if (part.type !== "toolCall") continue; + if (part.name === "bash") { + result.bash_calls += 1; + pendingBash.add(part.id); + result.commands.push(part.arguments?.command ?? ""); + } + if (part.name === "final_json") { + result.final_json_calls += 1; + } + } + if (message.role === "toolResult" && message.toolName === "bash") { + const exitCode = message.details?.exit_code; + const success = message.isError === false && (exitCode === undefined || exitCode === 0); + if (success) result.successful_bash_calls += 1; + else result.failed_bash_calls += 1; + pendingBash.delete(message.toolCallId); + } + } + result.failed_bash_calls += pendingBash.size; + } + result.models = [...models].sort(); + return result; +} + +function renderContext(target) { + const file = path.join(contextsDir, `${slug(target)}.md`); + const cached = findCachedContext(target); + if (cached) { + writeFileSync(file, readFileSync(cached, "utf8")); + return file; + } + const completed = run(localpagerBin, [ + "render-context", + target, + "--output", + file, + "--config", + configPath + ]); + writeFileSync(path.join(logsDir, `${slug(target)}.context.stdout.log`), completed.stdout); + writeFileSync(path.join(logsDir, `${slug(target)}.context.stderr.log`), completed.stderr); + if (completed.status !== 0) { + throw new Error(`render-context failed for ${target}: ${completed.stderr || completed.stdout}`); + } + return file; +} + +function findCachedContext(target) { + const contextName = `${slug(target)}.md`; + let runDirs = []; + try { + runDirs = readdirSync(path.join(scratchRoot, "experiments/reposhell-prompt-propensity")) + .filter((name) => name.startsWith("run-")) + .sort() + .reverse(); + } catch { + return ""; + } + for (const runDir of runDirs) { + const candidate = path.join( + scratchRoot, + "experiments/reposhell-prompt-propensity", + runDir, + "contexts", + contextName + ); + if (candidate.startsWith(outDir)) continue; + if (existsSync(candidate)) return candidate; + } + return ""; +} + +const contexts = new Map(); +for (const target of targets) { + contexts.set(target, renderContext(target)); +} + +const results = []; +for (const variant of variants) { + for (const target of targets) { + const id = `${variant.name}__${slug(target)}`; + const runStateDir = path.join(stateDir, id); + mkdirSync(runStateDir, { recursive: true }); + const args = [ + target, + "--schema", + schemaPath, + "--prompt-template", + path.join(promptsDir, `${variant.name}.prompt.md`), + "--topic-taxonomy", + taxonomyPath, + "--github-context-file", + contexts.get(target), + "--model", + "gemma-4-e4b-it", + "--base-url", + "http://127.0.0.1:1234/v1", + "--context-window", + "131072", + "--max-tokens", + "768", + "--temperature", + "0", + "--top-p", + "1", + "--timeout-ms", + "30000", + "--reposhell-socket", + reposhellSocket, + "--reposhell-default-repo", + "openclaw", + "--reposhell-visible-repos", + "openclaw", + "--state-dir", + path.join(outDir, "agent-state") + ]; + const started = Date.now(); + const completed = run(classifierPath, args, { + env: { + ...process.env, + LOCALPAGER_CLASSIFIER_STATE_DIR: runStateDir, + LOCALPAGER_CONFIG: configPath + } + }); + const elapsedMs = Date.now() - started; + writeFileSync(path.join(logsDir, `${id}.stdout.log`), completed.stdout); + writeFileSync(path.join(logsDir, `${id}.stderr.log`), completed.stderr); + const sessionDir = extractPath(completed.stderr, "session"); + const promptPath = extractPath(completed.stderr, "prompt"); + const schemaRuntimePath = extractPath(completed.stderr, "schema"); + const session = parseSession(sessionDir); + results.push({ + id, + variant: variant.name, + target, + status: completed.status, + elapsed_ms: elapsedMs, + prompt_path: promptPath, + schema_path: schemaRuntimePath, + stdout_log: path.join(logsDir, `${id}.stdout.log`), + stderr_log: path.join(logsDir, `${id}.stderr.log`), + ...session + }); + console.log( + `${variant.name} ${target}: status=${completed.status} bash=${session.bash_calls} success=${session.successful_bash_calls} final_json=${session.final_json_calls}` + ); + } +} + +const byVariant = variants.map((variant) => { + const rows = results.filter((row) => row.variant === variant.name); + const sessionsWithBash = rows.filter((row) => row.bash_calls > 0).length; + const sessionsWithSuccessfulBash = rows.filter((row) => row.successful_bash_calls > 0).length; + return { + variant: variant.name, + runs: rows.length, + failures: rows.filter((row) => row.status !== 0).length, + sessions_with_bash: sessionsWithBash, + bash_session_rate: sessionsWithBash / rows.length, + sessions_with_successful_bash: sessionsWithSuccessfulBash, + successful_bash_session_rate: sessionsWithSuccessfulBash / rows.length, + bash_calls: rows.reduce((sum, row) => sum + row.bash_calls, 0), + successful_bash_calls: rows.reduce((sum, row) => sum + row.successful_bash_calls, 0), + final_json_calls: rows.reduce((sum, row) => sum + row.final_json_calls, 0), + mean_elapsed_ms: rows.reduce((sum, row) => sum + row.elapsed_ms, 0) / rows.length + }; +}); + +const summary = { + created_at: new Date().toISOString(), + out_dir: outDir, + localpager_root: localpagerRoot, + model: "gemma-4-e4b-it", + targets, + variants: variants.map((variant) => ({ + name: variant.name, + prompt_path: path.join(promptsDir, `${variant.name}.prompt.md`), + inserted_text: variant.insert + })), + by_variant: byVariant, + results +}; + +writeFileSync(path.join(outDir, "results.json"), JSON.stringify(summary, null, 2) + "\n"); + +const md = [ + "# Reposhell Prompt Propensity Experiment", + "", + `Created: ${summary.created_at}`, + "", + "Goal: test whether prompt wording can increase voluntary read-only repository inspection without explicitly naming or requiring the `bash` tool.", + "", + "## Setup", + "", + `- Model: \`${summary.model}\``, + `- Target count: ${targets.length}`, + `- Variant count: ${variants.length}`, + "- Reposhell was exposed through the Localpager agent runtime.", + "- Localpager repo files were not edited; generated prompts, logs, sessions, and summaries are under this scratch experiment directory.", + "", + "## Summary", + "", + "| Variant | Runs | Sessions with bash | Successful bash sessions | Bash calls | Successful bash calls | Failures | Mean elapsed ms |", + "|---|---:|---:|---:|---:|---:|---:|---:|", + ...byVariant.map((row) => + [ + `| ${row.variant}`, + row.runs, + `${row.sessions_with_bash} (${(row.bash_session_rate * 100).toFixed(1)}%)`, + `${row.sessions_with_successful_bash} (${(row.successful_bash_session_rate * 100).toFixed(1)}%)`, + row.bash_calls, + row.successful_bash_calls, + row.failures, + Math.round(row.mean_elapsed_ms) + ].join(" | ") + " |" + ), + "", + "## Variants", + "", + ...variants.flatMap((variant) => [ + `### ${variant.name}`, + "", + variant.insert === "" ? "Baseline production prompt." : variant.insert.trim(), + "" + ]), + "## Per-Run Results", + "", + "| Variant | Target | Status | Bash calls | Successful bash calls | Final JSON calls | Commands |", + "|---|---|---:|---:|---:|---:|---|", + ...results.map((row) => + [ + `| ${row.variant}`, + row.target, + row.status, + row.bash_calls, + row.successful_bash_calls, + row.final_json_calls, + row.commands.length === 0 + ? "" + : row.commands.map((command) => `\`${command.replaceAll("|", "\\|")}\``).join("
") + ].join(" | ") + " |" + ), + "", + "Full machine-readable output: `results.json`." +].join("\n"); +writeFileSync(path.join(outDir, "README.md"), md + "\n"); + +console.log(`wrote ${outDir}`);