Skip to content

[fix] Resolve Annotations created as Invocations if links={}#4385

Merged
junaway merged 2 commits into
release/v0.100.1from
fix/broken-annotations-created-as-invocations
May 20, 2026
Merged

[fix] Resolve Annotations created as Invocations if links={}#4385
junaway merged 2 commits into
release/v0.100.1from
fix/broken-annotations-created-as-invocations

Conversation

@junaway
Copy link
Copy Markdown
Contributor

@junaway junaway commented May 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 13:47
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment May 20, 2026 1:49pm

Request Review

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 093b8cd5-14d8-4e12-a16b-ca32d9545f38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/broken-annotations-created-as-invocations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot Bot added the bug Something isn't working label May 20, 2026
@junaway junaway merged commit 98af78a into release/v0.100.1 May 20, 2026
6 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates trace-type inference so that annotations created with an explicitly provided but empty links payload (e.g., links={} from the frontend, converted to []) are classified as ANNOTATION rather than INVOCATION.

Changes:

  • Updated infer_and_propagate_trace_type_by_trace to treat “links explicitly set” (including []) as an annotation signal.
  • Added a unit test to ensure links=[] is classified as ANNOTATION while links=None remains INVOCATION.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api/oss/src/core/tracing/utils/trees.py Changes the trace-type inference predicate from “non-empty links” to “links not None”.
api/oss/tests/pytest/unit/tracing/utils/test_trees.py Adds coverage for links=[] being treated as an annotation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 113 to 117
trace_key = str(trace_spans[0].trace_id)
trace_types_by_trace[trace_key] = (
TraceType.ANNOTATION
if any(span.links for span in trace_spans)
if any(span.links is not None for span in trace_spans)
else TraceType.INVOCATION
Comment on lines +318 to +322
def test_infer_and_propagate_trace_type_by_trace_treats_empty_links_as_annotation():
# A queue annotation on a testcase has no link target, so the frontend sends
# links={}, which build_otel_links converts to an empty list []. An explicitly
# set (even empty) links list means annotation; only None means invocation.
trace_a = "trace-a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants