You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2026/10/07 14:42:24 UTC

(skywalking-query-protocol) 01/01: Name the hide parameter of the AI agent conversation routes

This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch ai-agent-hide
in repository https://gitbox.apache.org/repos/asf/skywalking-query-protocol.git

commit 1737d06cf9a34bea74573cf314ff03e818b3a806
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Wed Oct 7 22:42:16 2026 +0800

    Name the hide parameter of the AI agent conversation routes
    
    The OAP can withhold the system prompt and the tool schemas a runtime
    sent its model, as the Sessionizer names them, from every reader by its
    hide setting and from one reader by a hide parameter on the view and the
    files routes. The comment on the routes says what the parameter takes,
    what a withheld document and a masked file look like, the two fields a
    masked file's naming line adds, and when the routes answer 400 for it.
---
 ai-agent-conversation.graphqls | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/ai-agent-conversation.graphqls b/ai-agent-conversation.graphqls
index ce1a956..71288f8 100644
--- a/ai-agent-conversation.graphqls
+++ b/ai-agent-conversation.graphqls
@@ -31,10 +31,19 @@
 # as `/graphql`, streamed as it is rendered and compressed when the client allows:
 #
 #   GET /ai-agent/conversations/{conversation}/v1/view?service={serviceName}&instance={instanceName}[&coldStage=true]
+#       [&hide={name}[,{name}]]
 #
 # `service` is the service name and `instance` the sender's instance name, both required, as a list row names
 # them. `coldStage`, optional and false by default, queries only BanyanDB's cold stage when true. The UI passes its
-# selected stage when opening a conversation. Otherwise the read uses the default hot/warm stages.
+# selected stage when opening a conversation. Otherwise the read uses the default hot/warm stages. `hide`, optional,
+# names what this reader withholds beyond what the OAP's `hide` setting withholds from every reader: `system_prompt`,
+# the system prompt the runtime sent its model, and `tool_schemas`, the schemas of the tools it offered, once or more,
+# each a name or names separated by commas. It adds names and never takes one away. The Sessionizer's adapters name
+# the records that carry them with those flags, and the OAP withholds by the flags, never by the text: a step read
+# from such a record keeps its node, its flags and its size, loses its `text` and has `state` `omitted`; no such
+# injection names a talk or a stream; `summary.withheld` counts the records withheld by name, once per record id,
+# and `{}` says nothing was asked; every count stays. The storage holds every file whole, and withholding happens as
+# the document is served.
 # `v1` is the document version: the body is one `asz.view` 1.0 document, everything a viewer renders,
 # evidence included, as `asz conversation` prints it. What the body is, the HTTP layer says: `Content-Type`
 # names the format and the version, `application/vnd.skywalking.asz.view+json; version=1.0`, or the `+yaml` twin when
@@ -42,8 +51,10 @@
 # own first two keys, `format` and `version`, say the same. `Content-Encoding` follows `Accept-Encoding`.
 # Verification is content, not an error: a missing round or a failed digest is written into the document's
 # `summary.state` and `summary.problems`, and the rest holds whatever could still be folded. The route answers
-# 400 when the service or the instance is not named, 404 when the sender stores no round of the conversation, 500
-# on a storage failure, each as `application/problem+json` (RFC 9457): `{"type": "about:blank", "title": "Not
+# 400 when the service or the instance is not named, when `hide` names something a reader may not withhold, or when
+# a key spells `hide` another way, such as `Hide` or `hide[]`, since either would otherwise read as no `hide` at
+# all; 404 when the sender stores no round of the conversation; 500 on a storage failure, each as
+# `application/problem+json` (RFC 9457): `{"type": "about:blank", "title": "Not
 # Found", "status": 404, "detail": "..."}`. It runs under its own timeout, the OAP's `viewRequestTimeout`, in place
 # of the server's default.
 #
@@ -52,9 +63,17 @@
 # every file: a reader chooses each one.
 #
 #   GET /ai-agent/conversations/{conversation}/v1/files?service={serviceName}&instance={instanceName}
-#       &session={session}&seq={seq}[&seq={seq}...][&coldStage=true]
+#       &session={session}&seq={seq}[&seq={seq}...][&coldStage=true][&hide={name}[,{name}]]
 #
-# `service`, `instance` and `coldStage` are as for the view. `session` is required, and so is `seq`, one to 32 times:
+# `service`, `instance`, `coldStage` and `hide` are as for the view. With a `hide`, in the OAP's setting or the
+# request, a file is served with what it holds of those names masked: a transcript record carrying one keeps its
+# envelope and its flags and every part loses its content, with `state` `omitted`; a request body is rebuilt from the
+# session's bodies, its prompt blocks and tool schemas replaced by markers, and written back as a body of its own,
+# one `lit` segment with its own `sha256` and `bytes`, `depth` 0 and `withheld` naming what was applied, so a reader
+# that checks a body against its manifest still can; a response is served as stored unless it refers to a request's
+# bytes, when it is written whole the same way. A rewritten file gets a closing line of its own, and a file whose
+# records stop before its closing line ends where a reader stops. A file with nothing to mask is the stored bytes.
+# `session` is required, and so is `seq`, one to 32 times:
 # a file's landed seq, which the Sessionizer assigns once per file within a session, shared by every stream and kind,
 # and by which with the session the storage reads the file. The Sessionizer cuts a file at 2 MiB, so a response holds
 # about 64 MiB at most, and a reader wanting more asks again. The view document's `files` gives every file's seq and
@@ -70,12 +89,16 @@
 #   {"file":"<name>","seq":4,"lines":16,"bytes":27874,"digest":"<sha256>"}
 #   <exactly `bytes` bytes: the file, whose sha256 is `digest`>
 #
-# `file` is the file's name as the view document lists it and `lines` the file's own newline count. A non-empty file
+# `file` is the file's name as the view document lists it and `lines` the file's own newline count. A file served
+# with something masked carries two more fields, `withheld`, the names applied, and `served_digest`, the sha256 of
+# the bytes served; `digest` stays the stored file's, which the view document's `files` names, and `bytes` and
+# `lines` are the served file's. Both are absent when the bytes are the stored ones, and then `digest` is theirs. A non-empty file
 # that does not end with a newline is followed by one, which is not part of it, so the next naming line starts a line;
 # an empty file is followed by nothing. A file the Sessionizer wrote ends with a newline, so a reader may equally take
 # `lines` lines. The files come in seq order, which is the order provider bodies must be read in. The route answers
 # 400 when the service, the instance or the session is not named, when no seq is, when more than 32 are, when one is
-# not a positive whole number, or when `coldStage` is neither true nor false; 404 when the sender stores no round of the
+# not a positive whole number, when `coldStage` is neither true nor false, or when `hide` is refused as the view
+# refuses it; 404 when the sender stores no round of the
 # conversation; 500 on a storage failure before the first file, each as `application/problem+json`. A failure after
 # the first file ends the response early: a reader sees a file shorter than its naming line says, or a response that
 # does not complete.