From 40862bccb8ca558484ce1c2a6cd6cbe4a4bcf789 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Thu, 25 Jun 2026 21:41:13 +0800 Subject: [PATCH] feat(spec): add ToolExecutionContext.userMessageText contract field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional, neutral field carrying the latest user message — for a tool to detect explicit user intent (e.g. a confirm/approval) without re-deriving it from the transcript. Consumed by cloud's confirm-before-change gate. Scope reduced after #2325 (ADR-0025) removed framework service-ai: the agent route that POPULATES this now lives with the AI runtime (cloud-owned), so this PR adds only the contract field; cloud wires the value when it owns the route. Co-Authored-By: Claude Opus 4.8 --- packages/spec/src/contracts/ai-service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/spec/src/contracts/ai-service.ts b/packages/spec/src/contracts/ai-service.ts index 6b202e2f01..e96162e077 100644 --- a/packages/spec/src/contracts/ai-service.ts +++ b/packages/spec/src/contracts/ai-service.ts @@ -427,6 +427,13 @@ export interface ToolExecutionContext { currentObjectName?: string; /** View the user is currently viewing, if known. */ currentViewName?: string; + /** + * Text of the latest user message (neutral context, like currentObjectName). + * Forwarded so a tool can detect intent — e.g. an explicit confirm/approval — + * without re-deriving it from the transcript. Consumers own any semantics. + * Populated by whichever layer owns the agent route (cloud, post-ADR-0025). + */ + userMessageText?: string; /** Distributed-trace id for cross-service correlation. */ traceId?: string; /**