-
Notifications
You must be signed in to change notification settings - Fork 808
fix(openai-agents): propagate gen_ai.agent.name through an agent flow + set workflow name to fast mcp #3388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5ec59e4
added agent_name
nina-kollman e465a41
added test
nina-kollman 9d9f2d9
instrumentation works
nina-kollman 34acb9b
function
nina-kollman 61c6625
finetune
nina-kollman 4565a38
remove tests
nina-kollman 95631f5
remove
nina-kollman c892182
added one cetralized test
nina-kollman 9bffed3
mcp v1
nina-kollman 7500653
try
nina-kollman 8bf92d6
wip
nina-kollman e5b7af7
working version
nina-kollman 0295813
works 2
nina-kollman 6322453
c
nina-kollman 7e07055
wip
nina-kollman 9e03c88
init the Fast mcp
nina-kollman c94f40e
agent name works
nina-kollman cfe08f8
fix test
nina-kollman 8e48bd9
lint
nina-kollman d441204
comments
nina-kollman 3699ef5
no need to agent
nina-kollman bdcbd86
wip
nina-kollman 1f311b9
add test
nina-kollman b9bfba5
lint
nina-kollman fc3312b
test pass?
nina-kollman a104572
pretty pass?
nina-kollman 1c7a3aa
mock traceloop
nina-kollman 5370969
pr comment
nina-kollman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
179 changes: 179 additions & 0 deletions
179
...agents/tests/cassettes/test_openai_agents/test_agent_name_propagation_to_agent_spans.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
interactions: | ||
- request: | ||
body: '{"data":[{"object":"trace.span","id":"span_1682072c4a874ee68e5ab580","trace_id":"trace_2dc4a148df4c45ed8b309c32cc5c11a9","parent_id":"span_c0ea12fef2fa41949a7e3aa4","started_at":"2025-08-15T17:56:02.384852+00:00","ended_at":"2025-08-15T17:56:03.612731+00:00","span_data":{"type":"response","response_id":"resp_689f74b2f1e0819088b30c8105dc8b290a33650d0eca9a46"},"error":null},{"object":"trace.span","id":"span_f69f0eed2a614f6ca2486935","trace_id":"trace_2dc4a148df4c45ed8b309c32cc5c11a9","parent_id":"span_c0ea12fef2fa41949a7e3aa4","started_at":"2025-08-15T17:56:03.613427+00:00","ended_at":"2025-08-15T17:56:03.613997+00:00","span_data":{"type":"function","name":"generate_report","input":"{\"processed_data\":\"Processed | ||
results: Analyzed data patterns for: Sales data from last quarter\"}","output":"Generated | ||
report: Processed results: Analyzed data patterns for: Sales data from last | ||
quarter","mcp_data":null},"error":null},{"object":"trace.span","id":"span_40705905ad4149d79d4419ad","trace_id":"trace_2dc4a148df4c45ed8b309c32cc5c11a9","parent_id":"span_c0ea12fef2fa41949a7e3aa4","started_at":"2025-08-15T17:56:03.614647+00:00","ended_at":"2025-08-15T17:56:08.170805+00:00","span_data":{"type":"response","response_id":"resp_689f74b439dc81909f83fedf09751dfe0a33650d0eca9a46"},"error":null},{"object":"trace.span","id":"span_c0ea12fef2fa41949a7e3aa4","trace_id":"trace_2dc4a148df4c45ed8b309c32cc5c11a9","parent_id":null,"started_at":"2025-08-15T17:55:59.725264+00:00","ended_at":"2025-08-15T17:56:08.171797+00:00","span_data":{"type":"agent","name":"Analytics | ||
Agent","handoffs":[],"tools":["analyze_data","process_results","generate_report"],"output_type":"str"},"error":null},{"object":"trace","id":"trace_6a430ad653c745b78c89622b8e61fccc","workflow_name":"Agent | ||
workflow","group_id":null,"metadata":null}]}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '1811' | ||
content-type: | ||
- application/json | ||
cookie: | ||
- __cf_bm=UhrfEFws9O_ZBKuSryCKFovrTxciXL8p2WJuM1K2dN8-1755280562-1.0.1.1-dIIsnsWKGJtA9W6u0MbXjq7UUseSGAthIGNSZMriLzkecTBUlPjjJFr6r0QnteF8Ul.liPTWhJI6mlCKQBREwPTAAOYdCC2ZirAu9ZrwIWA; | ||
nina-kollman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_cfuvid=zDtlMy4g5CGjInt8L2ecM4HeWcHtz0bFgxVbfE5vSqk-1755280562683-0.0.1.1-604800000 | ||
host: | ||
nina-kollman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- api.openai.com | ||
openai-beta: | ||
- traces=v1 | ||
user-agent: | ||
- python-httpx/0.28.1 | ||
method: POST | ||
uri: https://api.openai.com/v1/traces/ingest | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
CF-RAY: | ||
- 96fa91223a586901-FRA | ||
Connection: | ||
- keep-alive | ||
Date: | ||
- Fri, 15 Aug 2025 17:56:09 GMT | ||
Server: | ||
- cloudflare | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400 | ||
cf-cache-status: | ||
- DYNAMIC | ||
openai-organization: | ||
- traceloop | ||
openai-processing-ms: | ||
- '242' | ||
openai-project: | ||
- proj_tzz1TbPPOXaf6j9tEkVUBIAa | ||
openai-version: | ||
nina-kollman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- '2020-10-01' | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
x-envoy-upstream-service-time: | ||
- '253' | ||
x-request-id: | ||
- req_874f73c01f3025bae3501d414db98cdf | ||
status: | ||
code: 204 | ||
message: No Content | ||
- request: | ||
body: '{"include":[],"input":[{"content":"What is AI?","role":"user"}],"instructions":"You | ||
are a helpful assistant that answers all questions","max_output_tokens":1024,"model":"gpt-4.1","stream":false,"temperature":0.3,"tools":[],"top_p":0.2}' | ||
headers: | ||
accept: | ||
- application/json | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '235' | ||
content-type: | ||
- application/json | ||
cookie: | ||
- __cf_bm=WwDHl7j6.dqwOcLIJAXqGOLTR6ZUq3JCq47vW3LBIBs-1755280559-1.0.1.1-na9dmQo.4u4zv1vUQ7SN457JVcBR1ifes3cOUutsLuVtLSfo_sZ1I8fRayi6NDR2VKiwUFBhrUYM85dJ8BB7Ior2pM9Ng5MfNJwvGRd3lgE; | ||
_cfuvid=PWHn6CD5_OXbE3jv9HT7E4FDlSvoTN5AciqTl4Chslg-1755280559217-0.0.1.1-604800000 | ||
host: | ||
- api.openai.com | ||
user-agent: | ||
- Agents/Python 0.2.7 | ||
x-stainless-arch: | ||
- arm64 | ||
x-stainless-async: | ||
- async:asyncio | ||
x-stainless-lang: | ||
- python | ||
x-stainless-os: | ||
- MacOS | ||
x-stainless-package-version: | ||
- 1.99.9 | ||
x-stainless-read-timeout: | ||
- '600' | ||
x-stainless-retry-count: | ||
- '1' | ||
x-stainless-runtime: | ||
- CPython | ||
x-stainless-runtime-version: | ||
- 3.10.13 | ||
method: POST | ||
uri: https://api.openai.com/v1/responses | ||
response: | ||
body: | ||
string: !!binary | | ||
H4sIAAAAAAAAA3RV227jNhB9z1cM9LQ14kB2nET2m1EURYCiKLrdAsWmEEbUSGLNi5YcOtEu8u8F | ||
KVmx2+yLYc3lcOYczvDbFUAm62wHmSPfl/fFtnnYVNuioqJY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2mecX1zuqeS4Gio/JA | ||
w7nPEXobK8x20w7JqGms47OguI9GSifjFcDr+DxgQzyUsiYTp58uVv8kTcmjPaupwaDGTZR5to7O | ||
m2DSPbk4hdGc39xO1rRxpsri/OPb99mmS3Eja1PFR3KV9ZKHcb/WMuhsrnvksbNSjMQHttnseFt8 | ||
Gdu+PFuH+WzsU43r8dsFI9ItT11Kj5U6PZMhrfW5AWkunqfxcfqP/eydnNtM0tVviflFq/979e7u | ||
3/O8BzzL/z1stozqDLrIZxKDv9RbE2ONjBH/9er1XwAAAP//AwB79dv3tQgAAA== | ||
headers: | ||
CF-RAY: | ||
- 96fa9123bba209c9-HFA | ||
Connection: | ||
- keep-alive | ||
Content-Encoding: | ||
- gzip | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 15 Aug 2025 17:56:12 GMT | ||
Server: | ||
- cloudflare | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400 | ||
cf-cache-status: | ||
- DYNAMIC | ||
openai-organization: | ||
- traceloop | ||
openai-processing-ms: | ||
- '2970' | ||
openai-project: | ||
- proj_tzz1TbPPOXaf6j9tEkVUBIAa | ||
openai-version: | ||
- '2020-10-01' | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
x-envoy-upstream-service-time: | ||
- '2974' | ||
x-ratelimit-limit-requests: | ||
- '10000' | ||
x-ratelimit-limit-tokens: | ||
- '30000000' | ||
x-ratelimit-remaining-requests: | ||
- '9999' | ||
x-ratelimit-remaining-tokens: | ||
- '29999957' | ||
x-ratelimit-reset-requests: | ||
- 6ms | ||
x-ratelimit-reset-tokens: | ||
- 0s | ||
x-request-id: | ||
- req_75dd7627c6cae3f69948923a1d3a4850 | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.