@botlearn-course/daemon 0.0.28-beta.4 → 0.0.28-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,7 @@ const RESULT_FIELDS = new Set([
47
47
  * and paths inside the current workspace become workspace-relative. Other semantic content,
48
48
  * including execution-host paths outside that workspace, stays intact. `detail_preview` is
49
49
  * a bounded feed-sized excerpt; `detail_full` carries the same allowlisted projection at
50
- * audit fidelity (deeper walk, larger arrays, 64k chars). Message text, request IDs, and
50
+ * audit fidelity (deeper walk, larger arrays, 64k chars). Message text, model request IDs, and
51
51
  * arbitrary envelope metadata never cross this boundary.
52
52
  */
53
53
  export function buildToolObservation(block, runtime, workspaceDir) {
@@ -77,7 +77,9 @@ export function buildToolObservation(block, runtime, workspaceDir) {
77
77
  const detailFull = detailFullTruncated
78
78
  ? `${serializedFull.slice(0, DETAIL_FULL_MAX_CHARS - 1)}…`
79
79
  : serializedFull;
80
+ const callId = toolCallId(block.raw);
80
81
  return {
82
+ ...(callId ? { tool_call_id: callId } : {}),
81
83
  schema_version: AGENT_TOOL_OBSERVATION_SCHEMA_VERSION,
82
84
  kind: block.kind,
83
85
  runtime,
@@ -143,3 +145,20 @@ function normalizeWorkspacePaths(value, workspaceDir) {
143
145
  normalizeWorkspacePaths(item, workspaceDir),
144
146
  ]));
145
147
  }
148
+ function toolCallId(raw, depth = 0) {
149
+ if (!raw || typeof raw !== "object" || depth > 4)
150
+ return undefined;
151
+ const value = raw;
152
+ for (const key of ["tool_call_id", "toolCallId", "call_id", "id"]) {
153
+ const candidate = value[key];
154
+ if (typeof candidate === "string" && /^[A-Za-z0-9_.:-]{1,120}$/.test(candidate)
155
+ && redactSecretsDeep(candidate) === candidate)
156
+ return candidate;
157
+ }
158
+ for (const key of ["payload", "raw", "data", "tool_call", "item"]) {
159
+ const found = toolCallId(value[key], depth + 1);
160
+ if (found)
161
+ return found;
162
+ }
163
+ return undefined;
164
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botlearn-course/daemon",
3
- "version": "0.0.28-beta.4",
3
+ "version": "0.0.28-beta.6",
4
4
  "description": "Lightweight BotLearn Course daemon: run course tasks on your own machine with your own agent runtime (BYOA).",
5
5
  "type": "module",
6
6
  "bin": {