Skip to content

feat(integrations): add google antigravity sdk tracing - #1112

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi/add-antigravity-sdk-1248bcda
Open

Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi/add-antigravity-sdk-1248bcda

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

instruments https://github.com/google-antigravity/antigravity-sdk-python

🤖 This text was AI-generated.

Antigravity agent chats previously had no Braintrust instrumentation:

response = await agent.chat("Hello")

Enable tracing through the existing auto-instrumentation entry point:

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.

> 🤖 **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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:53:05.857217Z 564b579 PR opened
ℹ️ About Codex in GitHub

Your 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +247 to +250
_finish_pending(instance)
state = None
try:
state = _ChatState(instance, prompt)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant