Repository navigation
feat(integrations): add google antigravity sdk tracing - #1112
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
Conversation
> 🤖 **This text was AI-generated.**
Antigravity agent chats previously had no Braintrust instrumentation:
```python
response = await agent.chat("Hello")
```
Enable tracing through the existing auto-instrumentation entry point:
```python
braintrust.auto_instrument()
response = await agent.chat("Hello")
print(await response.text())
```
Capture chat tasks, execution steps, Python tools, attachments, structured
output, and turn-level usage while preserving streaming and cleanup. Add
manual setup and wrapping, minimum 0.1.23 and latest matrix pins, and
versioned recordings of the real harness transport.
The runtime does not expose individual model requests or built-in tool
results. Model steps remain task spans, and built-in tool outputs are
omitted rather than inferred.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 564b579306
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| _finish_pending(instance) | ||
| state = None | ||
| try: | ||
| state = _ChatState(instance, prompt) |
There was a problem hiding this comment.
Preserve the previous chat state until its turn finishes
When a caller starts another chat without fully consuming the previous response, the SDK supports this by draining the previous turn inside Conversation.send. This wrapper instead finishes the previous span before that drain and constructs a new _ChatState, which immediately reassigns _tool_chats to the new chat. Consequently, the previous chat loses its remaining usage and execution steps, and Python tools dispatched while draining it can be attributed to the next chat. Keep finalization and tool correlation aligned with the actual turn boundary.
Useful? React with 👍 / 👎.
| name=name, type="tool", input=tool_input, internal={"instrumentation": _INSTRUMENTATION} | ||
| ) as span: | ||
| result = await wrapped(*args, **kwargs) | ||
| span.log(output=result) |
There was a problem hiding this comment.
Materialize media returned by Python tools before logging
For Python tools returning types.Image, Document, Audio, or Video, including media nested in lists or dictionaries, logging result directly leaves the binary data inside a serialized provider object rather than creating a Braintrust attachment. These are supported tool results—the SDK explicitly extracts and transports nested media—but their traced output cannot be rendered as an attachment and embeds potentially large binary payloads in the span. Materialize media leaves with _materialize_attachment, preserving the surrounding result and returning the original provider value unchanged.
Useful? React with 👍 / 👎.
instruments https://github.com/google-antigravity/antigravity-sdk-python
Antigravity agent chats previously had no Braintrust instrumentation:
Enable tracing through the existing auto-instrumentation entry point:
Capture chat tasks, execution steps, Python tools, attachments, structured output, and turn-level usage while preserving streaming and cleanup. Add manual setup and wrapping, minimum 0.1.23 and latest matrix pins, and versioned recordings of the real harness transport.
The runtime does not expose individual model requests or built-in tool results. Model steps remain task spans, and built-in tool outputs are omitted rather than inferred.