fix(agents): forward ACP spawn attachments

Forward initial image/file attachments when spawning ACP subagents through the existing sessions_spawn attachment opt-in. Remove the PR-only acpEnabled config split so ACP uses the same attachment gate as other runtimes.

Also fix the PR branch CI fallout: type the browser element CLI request mock and use Vitest env stubs in the Azure speech test to satisfy the changed-path security scan.

Verification:
- GitHub CI passed on f6ca26b160.
- Autoreview clean.
- Crabbox AWS live OpenAI proof passed: cbx_a576d49493fe / run_081dcc6c6a1b.

Thanks @zhangguiping-xydt.
This commit is contained in:
zhang-guiping
2026-05-30 04:08:19 +08:00
committed by GitHub
parent f8ad20b87e
commit 689e8ec893
13 changed files with 428 additions and 53 deletions

View File

@@ -1,3 +1,4 @@
import { resolveInlineAgentImageAttachments } from "../auto-reply/reply/agent-turn-attachments.js";
import { sanitizePendingFinalDeliveryText } from "../auto-reply/reply/pending-final-delivery.js";
import {
formatThinkingLevels,
@@ -638,10 +639,12 @@ async function agentCommandInternal(
throw agentPolicyError;
}
const acpImageAttachments = resolveInlineAgentImageAttachments(opts.images);
await acpManager.runTurn({
cfg,
sessionKey,
text: body,
attachments: acpImageAttachments.length > 0 ? acpImageAttachments : undefined,
mode: "prompt",
requestId: runId,
signal: opts.abortSignal,