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/09/16 15:16:34 UTC

(skywalking-ai-sessionizer) branch fix-reasoning-signature-drop created (now 1912b13)

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

wu-sheng pushed a change to branch fix-reasoning-signature-drop
in repository https://gitbox.apache.org/repos/asf/skywalking-ai-sessionizer.git


      at 1912b13  Record the dropped reasoning signature whichever way the reasoning landed

This branch includes the following new commits:

     new 1912b13  Record the dropped reasoning signature whichever way the reasoning landed

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(skywalking-ai-sessionizer) 01/01: Record the dropped reasoning signature whichever way the reasoning landed

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch fix-reasoning-signature-drop
in repository https://gitbox.apache.org/repos/asf/skywalking-ai-sessionizer.git

commit 1912b134b813fe34c4e6cae4556f3c518e95bc8e
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Wed Sep 16 23:16:25 2026 +0800

    Record the dropped reasoning signature whichever way the reasoning landed
    
    A thinking block always carries a signature, and the adapter drops it: a
    provider verifies it and a reader cannot read it. A claude-code build writes
    one on every thinking block, because a runtime does. The sd writer recorded
    the drop only for reasoning whose text was already gone, so a block that kept
    its text landed with the drop in one format and without it in the other, and
    the same scenario no longer folded to the same conversation through both
    writers.
    
    Only `records_match` could see it, and nothing exercised it. Every scenario in
    the tree writes `thinking: unavailable`, which is the one branch that recorded
    the drop, so the branch with text had no cover at all. `reasoning-text.yaml`
    writes both shapes in one session. It fails without this change and passes with
    it.
---
 internal/scenario/write_sd.go              |  7 +++++-
 tests/scenarios/reasoning-text.expect.yaml | 23 ++++++++++++++++++++
 tests/scenarios/reasoning-text.yaml        | 34 ++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/internal/scenario/write_sd.go b/internal/scenario/write_sd.go
index aad7375..bb4369d 100644
--- a/internal/scenario/write_sd.go
+++ b/internal/scenario/write_sd.go
@@ -343,10 +343,15 @@ func (w *sdWriter) record(e *Event) *sessiondata.Record {
 		case FragThinking:
 			if e.Text == "" {
 				r.Parts = []sessiondata.Part{{Kind: sessiondata.PartReasoning, State: "unavailable"}}
-				r.Dropped = []sessiondata.Drop{{What: "reasoning signature", Bytes: 3, Why: "a provider verifies it; a reader cannot read it"}}
 			} else {
 				r.Parts = []sessiondata.Part{{Kind: sessiondata.PartReasoning, Text: e.Text, State: "available", Bytes: len(e.Text)}}
 			}
+			// Whether or not the reasoning text survived, the block carried a
+			// signature and the adapter dropped it. A claude-code build writes
+			// one on every thinking block, because a runtime does, so recording
+			// the drop only for reasoning that was already gone left the same
+			// scenario landing different records in the two formats.
+			r.Dropped = []sessiondata.Drop{{What: "reasoning signature", Bytes: 3, Why: "a provider verifies it; a reader cannot read it"}}
 		case FragText:
 			r.Parts = []sessiondata.Part{textPart(e.Text)}
 		case FragToolUse:
diff --git a/tests/scenarios/reasoning-text.expect.yaml b/tests/scenarios/reasoning-text.expect.yaml
new file mode 100644
index 0000000..d497e8a
--- /dev/null
+++ b/tests/scenarios/reasoning-text.expect.yaml
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# Both thinking records land the same way in both formats: the reasoning part
+# differs, the dropped signature does not.
+checkpoints:
+  final:
+    kinds: {thinking: 2}
diff --git a/tests/scenarios/reasoning-text.yaml b/tests/scenarios/reasoning-text.yaml
new file mode 100644
index 0000000..f18e528
--- /dev/null
+++ b/tests/scenarios/reasoning-text.yaml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# Reasoning a runtime kept the text of, beside reasoning it kept only the
+# signature of.
+#
+# A thinking block always carries a signature, and the adapter drops it: a
+# provider verifies it and a reader cannot read it. That is true whether or not
+# the reasoning text survived, so both records land with the drop recorded. The
+# sd writer used to record it only for reasoning that was already gone, and the
+# same scenario then landed different records in the two formats, which only
+# `records_match` could see. Every other scenario writes `unavailable`, so the
+# branch with text had no cover at all.
+steps:
+  - input: work out why the loader is slow
+  - call:
+      thinking: The second call reads the same file, so the cost is the parse and not the disk.
+      text: The parse is the cost.
+  - call: {thinking: unavailable, text: Caching the parsed form removes it.}