Skip to content

Commit 7db9a73

Browse files
os-zhuangclaude
andauthored
feat(spec): add ToolExecutionContext.userMessageText contract field (#2328)
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 <noreply@anthropic.com>
1 parent 8ba804e commit 7db9a73

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/spec/src/contracts/ai-service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,13 @@ export interface ToolExecutionContext {
427427
currentObjectName?: string;
428428
/** View the user is currently viewing, if known. */
429429
currentViewName?: string;
430+
/**
431+
* Text of the latest user message (neutral context, like currentObjectName).
432+
* Forwarded so a tool can detect intent — e.g. an explicit confirm/approval —
433+
* without re-deriving it from the transcript. Consumers own any semantics.
434+
* Populated by whichever layer owns the agent route (cloud, post-ADR-0025).
435+
*/
436+
userMessageText?: string;
430437
/** Distributed-trace id for cross-service correlation. */
431438
traceId?: string;
432439
/**

0 commit comments

Comments
 (0)