Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/instrumentation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Map the change before editing:
- Setup, teardown, and patching must be idempotent. Enabling twice, disabling twice, or applying a patch twice should remain safe.
- Promise/stream behavior must be preserved. Patches need to keep subclass/helper semantics intact.
- Contain instrumentation failures. Extraction/logging bugs should be logged or ignored as appropriate, but must not break the user call path.
- Use the SDK `debugLogger` for SDK instrumentation diagnostics. Do not call `console.*` directly from instrumentation code; direct console use should stay inside the debug logger implementation or another explicitly justified exception.
- Log only the useful surface. Prefer narrow, stable payloads over dumping full request/response objects; exclude redundant or overly large data when possible.
- We want to limit our instrumentation to operations that are relevant for AI generations and operations (LLMs, embeddings, media generation, ...). Things like creating entities on platforms (CRUD for Workflows of Agent entities) is irrelevant to us.
- When building instrumentation, we should always have a vendored type/interface for what we are wrapping. The type or interface should not be larger than what is relevant to the instrumentation. The type or interface should be used for typing tracing channels and also should be used to assert the type on whatever is passed into wrappers as soon as the wrapper has verified that the passed in value is plausibly what should be wrapped.
Expand Down
5 changes: 5 additions & 0 deletions .changeset/bright-eggs-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": minor
---

feat(google-genai): Add instrumentation for interactions API
3 changes: 2 additions & 1 deletion e2e/config/pr-comment-scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
{ "variantKey": "google-genai-v1300", "label": "v1.30.0" },
{ "variantKey": "google-genai-v1440", "label": "v1.44.0" },
{ "variantKey": "google-genai-v1450", "label": "v1.45.0" },
{ "variantKey": "google-genai-v1460", "label": "v1.46.0" }
{ "variantKey": "google-genai-v1460", "label": "v1.46.0" },
{ "variantKey": "google-genai-v280", "label": "v2.8.0" }
]
},
{
Expand Down
10 changes: 10 additions & 0 deletions e2e/helpers/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ const DYNAMIC_HEADER_KEYS = new Set([
const PROVIDER_ID_KEYS = new Set([
"agentId",
"claude_agent_sdk.task_id",
"interaction_id",
"itemId",
"previous_interaction_id",
"responseId",
"toolCallId",
]);
Expand Down Expand Up @@ -236,6 +238,14 @@ function normalizeObject(
}
}

if (
key === "signature" &&
typeof entry === "string" &&
(value.type === "thought" || value.type === "thought_signature")
) {
return [key, tokenFor(tokenMaps.ids, entry, "signature")];
}

return [key, normalizeValue(entry as Json, tokenMaps, options, key)];
}),
);
Expand Down

Large diffs are not rendered by default.

Loading
Loading