Skip to content

[feat] Resolve broken references in traces#4469

Merged
junaway merged 18 commits into
release/v0.100.8from
feat/add-retrieval-info-to-api-and-sdk
May 31, 2026
Merged

[feat] Resolve broken references in traces#4469
junaway merged 18 commits into
release/v0.100.8from
feat/add-retrieval-info-to-api-and-sdk

Conversation

@jp-agenta
Copy link
Copy Markdown
Member

@jp-agenta jp-agenta commented May 28, 2026

No description provided.

jp-agenta added 2 commits May 26, 2026 18:33
Previously RetrievalInfo lived under api/oss/src/apis/fastapi/git/ and the
routers assembled it directly, including making duplicate environment-revision
DB calls to gather environment-side references.

This commit moves the DTO and helpers to api/oss/src/core/git/ for symmetry
with ResolutionInfo, threads retrieval_info through the services as the third
element of a (revision, resolution_info, retrieval_info) tuple, and lets the
routers act as pass-throughs.

Highlights:
- core/git/dtos.py: RetrievalInfo Pydantic model
- core/git/utils.py: build_retrieval_info / revision_references helpers
- Six services updated to return the 3-tuple; environment-backed paths merge
  environment + target references inside the service, no router-level DB call
- Queries and testsets gain thin retrieve_*_revision wrappers for symmetry
- /revisions/retrieve and /revisions/resolve responses carry retrieval_info
- Unit + acceptance test coverage for all six entities, both retrieve and
  resolve, direct and environment-backed

No request-field renames in this commit; only the internal refactor and the
new retrieval_info on retrieve/resolve responses.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 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 30, 2026 5:25pm

Request Review

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. Backend refactoring A code change that neither fixes a bug nor adds a feature labels May 28, 2026
@junaway junaway changed the title refactor(api): add RetrievalInfo at the core layer [feat] Add retrieval_info and allow full environment references into traces May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Review Change Stack

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: 65a9f09b-378a-4b5b-a0c2-6a276a267490

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
📝 Walkthrough

Walkthrough

This PR adds retrieval provenance metadata to revision retrieval responses across multiple entity types (applications, environments, evaluators, workflows, queries, testsets). A new RetrievalInfo DTO captures which artifact/variant/revision references were actually used during retrieval, including optional environment-backed references and selector key. Services return 3-tuples including RetrievalInfo, routers unpack and forward it, response models expose it, and the Python SDK middleware propagates retrieval references into tracing context.

Changes

Retrieval Info Feature

Layer / File(s) Summary
Core retrieval info DTO and utilities
api/oss/src/core/git/dtos.py, api/oss/src/core/git/utils.py
RetrievalInfo model with references dict and optional key; revision_references() extracts typed refs from revision; build_retrieval_info() merges environment refs with revision refs and returns RetrievalInfo or None.
Service layer: Applications, Environments, Evaluators, Workflows
api/oss/src/core/applications/service.py, api/oss/src/core/environments/service.py, api/oss/src/core/evaluators/service.py, api/oss/src/core/workflows/service.py
Return type changed to 3-tuple (revision, resolution_info, retrieval_info); handle environment-backed reference extraction and key-based lookup; early-return (None, None, None) when refs or revisions missing; compute retrieval_info via build_retrieval_info().
Service layer: New retrieve methods for Queries and Testsets
api/oss/src/core/queries/service.py, api/oss/src/core/testsets/service.py
New async methods retrieve_query_revision() and retrieve_testset_revision() wrap existing fetch_* functions and return 2-tuple (revision, retrieval_info) with computed metadata.
Response models: Add retrieval_info field
api/oss/src/apis/fastapi/*/models.py (applications, environments, evaluators, workflows, queries, testsets)
All revision response models (including resolve variants) extended with optional retrieval_info: Optional[RetrievalInfo] field.
Router integration: Core 4 entity types
api/oss/src/apis/fastapi/applications/router.py, environments/router.py, evaluators/router.py, workflows/router.py
Unpack 3-tuple from services and include retrieval_info in response models; resolve endpoints construct retrieval_info locally via build_retrieval_info().
Router integration: Queries and Testsets
api/oss/src/apis/fastapi/queries/router.py, testsets/router.py
Handle both cache hits (derive retrieval_info locally) and cache misses (unpack from service); include in response models.
Legacy variants router compatibility
api/oss/src/apis/fastapi/legacy_variants/router.py
Update tuple unpacking in _fetch_variant_revision() and _fetch_environment_revision() to accommodate 3-tuple returns while discarding extra values.
Unit tests: Utilities and services
api/oss/tests/pytest/unit/git/test_retrieval_info_utils.py, applications/test_retrieve_resolve.py, environments/test_retrieve_resolve.py, evaluators/test_retrieve_resolve.py, workflows/test_retrieve_resolve.py, queries/test_retrieve.py, testsets/test_retrieve.py
Test revision_references() and build_retrieval_info() across edge cases and data merging scenarios; service tests cover direct, environment-backed, missing-key, and resolve paths with mocked DAOs.
Unit test updates: Router and mocks
api/oss/tests/pytest/unit/applications/test_router.py, workflows/test_flag_ownership.py, legacy_variants/test_configs_fetch.py
Add new router retrieval_info pass-through test; update existing mocks to return 3-tuples; update workflow test to unpack retrieval_info.
Acceptance tests: All entity types
api/oss/tests/pytest/acceptance/*/test_*_retrieval_info.py (applications, environments, evaluators, workflows, queries, testsets)
End-to-end validation that retrieve/resolve endpoints return retrieval_info with correct typed reference IDs; environment-backed tests verify reference merging and key handling; negative tests verify 404 on missing keys.

Python SDK Resolver Middleware Integration

Layer / File(s) Summary
SDK resolver middleware: Extract and propagate retrieval references
sdks/python/agenta/sdk/middlewares/running/resolver.py
New resolve_references_with_info() returns (revision, retrieval_references, retrieval_selector) tuple; refactored result parsing extracts references and selector from API responses via shared helpers; ResolverMiddleware calls resolve_references_with_info(), merges retrieval references and selector into TracingContext via _merge_tracing_references()/_merge_tracing_selector, then continues with hydrated revision.
SDK middleware tests
sdks/python/oss/tests/pytest/utils/test_resolver_middleware.py, sdks/python/oss/tests/pytest/utils/test_selector_span_attribute.py
Tests verify retrieval references and selector are stored on TracingContext, and that TraceProcessor writes ag.selector.key to spans when selector is present.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Agenta-AI/agenta#4418: Both PRs modify the workflow-revision retrieve flow (api/oss/src/apis/fastapi/workflows/router.py and related workflow service logic), but main PR threads/returns retrieval_info while retrieved PR changes request validation and DAO guardrails to prevent ambiguous/incorrect workflow revisions.
  • Agenta-AI/agenta#4491: Overlaps in FastAPI applications revision endpoints; this PR adds retrieval_info wiring while that PR updates publish/revision event handling and related endpoint behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-retrieval-info-to-api-and-sdk

@junaway
Copy link
Copy Markdown
Contributor

junaway commented May 28, 2026

@mmabrouk
This PR should (help) resolve this issue.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-05-31T11:47:40.501Z

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
api/oss/src/core/applications/service.py (1)

595-627: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Derive the environment selector key before lookup.

This branch now returns None, None, None whenever key is omitted, even though the API contract in api/oss/src/apis/fastapi/applications/models.py (Lines 403-409) says the server derives it from application_ref. That breaks documented environment-backed retrievals like {application_slug}.revision.

Suggested fix
         environment_retrieval_info: Optional[RetrievalInfo] = None
         is_environment_backed = bool(
             environment_ref or environment_variant_ref or environment_revision_ref
         )

         if is_environment_backed:
+            if key is None and application_ref and application_ref.slug:
+                key = f"{application_ref.slug}.revision"
+
             environments_service = self.workflows_service.environments_service
             if not environments_service:
                 return None, None, None
api/oss/src/core/workflows/service.py (1)

1153-1233: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Replace the positional 3-tuple with a typed result DTO.

This expands a brittle unpack-by-position contract across layers, and callers are already discarding elements positionally in _ensure_request_revision(). A dedicated BaseModel result would make the contract self-describing and safer to evolve.

As per coding guidelines, Service methods must return typed DTOs (Pydantic BaseModel subclasses), not raw dicts, tuples, or Any.

🧹 Nitpick comments (2)
api/oss/tests/pytest/unit/applications/test_router.py (1)

195-206: ⚡ Quick win

Assert the router actually delegates to applications_service.retrieve_application_revision.

This test validates the returned payload, but not the service invocation itself. Add an explicit await assertion to protect the router-to-service contract.

Proposed test hardening
     assert response.retrieval_info is not None
     assert response.retrieval_info.key == "demo-app.revision"
     assert response.retrieval_info.references["environment"].id == environment_id
     assert response.retrieval_info.references["environment_revision"].version == "7"
     assert (
         response.retrieval_info.references["application_revision"].id
         == application_revision_id
     )
+    applications_service.retrieve_application_revision.assert_awaited_once()
     # The router no longer does its own env round-trip; the applications service
     # owns environment lookup and reference assembly.
     environments_service.retrieve_environment_revision.assert_not_awaited()
api/oss/src/apis/fastapi/queries/models.py (1)

3-3: ⚡ Quick win

Document the new retrieval_info field in the public schema.

Line 152 adds a new response field, but unlike the other retrieval_info additions in this PR it has no Field(...) metadata, so the OpenAPI schema won't explain what clients should expect here.

Suggested patch
-from pydantic import BaseModel
+from pydantic import BaseModel, Field
@@
 class QueryRevisionResponse(BaseModel):
     count: int = 0
     query_revision: Optional[QueryRevision] = None
-    retrieval_info: Optional[RetrievalInfo] = None
+    retrieval_info: Optional[RetrievalInfo] = Field(
+        default=None,
+        description="References used to retrieve the top-level revision.",
+    )

Also applies to: 149-152


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c0dd2d2d-ca02-4739-a11b-d11dbc5678e5

📥 Commits

Reviewing files that changed from the base of the PR and between fec4391 and e3bb6b8.

📒 Files selected for processing (45)
  • api/oss/src/apis/fastapi/applications/models.py
  • api/oss/src/apis/fastapi/applications/router.py
  • api/oss/src/apis/fastapi/environments/models.py
  • api/oss/src/apis/fastapi/environments/router.py
  • api/oss/src/apis/fastapi/evaluators/models.py
  • api/oss/src/apis/fastapi/evaluators/router.py
  • api/oss/src/apis/fastapi/legacy_variants/router.py
  • api/oss/src/apis/fastapi/queries/models.py
  • api/oss/src/apis/fastapi/queries/router.py
  • api/oss/src/apis/fastapi/testsets/models.py
  • api/oss/src/apis/fastapi/testsets/router.py
  • api/oss/src/apis/fastapi/workflows/models.py
  • api/oss/src/apis/fastapi/workflows/router.py
  • api/oss/src/core/applications/service.py
  • api/oss/src/core/environments/service.py
  • api/oss/src/core/evaluators/service.py
  • api/oss/src/core/git/dtos.py
  • api/oss/src/core/git/utils.py
  • api/oss/src/core/queries/service.py
  • api/oss/src/core/testsets/service.py
  • api/oss/src/core/workflows/service.py
  • api/oss/tests/pytest/acceptance/applications/test_application_retrieval_info.py
  • api/oss/tests/pytest/acceptance/environments/test_environment_retrieval_info.py
  • api/oss/tests/pytest/acceptance/evaluators/test_evaluator_retrieval_info.py
  • api/oss/tests/pytest/acceptance/queries/test_query_retrieval_info.py
  • api/oss/tests/pytest/acceptance/testsets/test_testset_retrieval_info.py
  • api/oss/tests/pytest/acceptance/workflows/test_workflow_retrieval_info.py
  • api/oss/tests/pytest/unit/applications/__init__.py
  • api/oss/tests/pytest/unit/applications/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/applications/test_router.py
  • api/oss/tests/pytest/unit/environments/__init__.py
  • api/oss/tests/pytest/unit/environments/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/evaluators/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/git/__init__.py
  • api/oss/tests/pytest/unit/git/test_retrieval_info_utils.py
  • api/oss/tests/pytest/unit/legacy_variants/test_configs_fetch.py
  • api/oss/tests/pytest/unit/queries/__init__.py
  • api/oss/tests/pytest/unit/queries/test_retrieve.py
  • api/oss/tests/pytest/unit/testsets/__init__.py
  • api/oss/tests/pytest/unit/testsets/test_retrieve.py
  • api/oss/tests/pytest/unit/workflows/__init__.py
  • api/oss/tests/pytest/unit/workflows/test_flag_ownership.py
  • api/oss/tests/pytest/unit/workflows/test_retrieve_resolve.py
  • sdks/python/agenta/sdk/middlewares/running/resolver.py
  • sdks/python/oss/tests/pytest/utils/test_resolver_middleware.py

Comment thread api/oss/src/core/queries/service.py
Comment thread api/oss/src/core/testsets/service.py
Comment thread api/oss/tests/pytest/acceptance/applications/test_application_retrieval_info.py Outdated
Comment thread api/oss/tests/pytest/acceptance/environments/test_environment_retrieval_info.py Outdated
Comment thread api/oss/tests/pytest/acceptance/evaluators/test_evaluator_retrieval_info.py Outdated
Comment thread api/oss/tests/pytest/acceptance/evaluators/test_evaluator_retrieval_info.py Outdated
Comment thread api/oss/tests/pytest/acceptance/queries/test_query_retrieval_info.py Outdated
Comment thread api/oss/tests/pytest/acceptance/testsets/test_testset_retrieval_info.py Outdated
@junaway junaway marked this pull request as draft May 28, 2026 07:36
@junaway junaway changed the base branch from main to release/v0.100.8 May 29, 2026 15:27
Resolved conflicts by keeping both import sets (RetrievalInfo/build_retrieval_info
from HEAD and validate_* functions from incoming) across all service and router
files. In environments/service.py, adopted the incoming simplification of
retrieve_environment_revision to delegate to fetch_environment_revision (which
includes the full validation set), restored build_retrieval_info call and fixed
the incorrect 2-tuple return to 3-tuple. In the SDK test file, kept HEAD's
test_stores_retrieval_references_on_tracing_context method and appended the
incoming TestResolverMiddlewareTracingParameters class. Dropped unused
VariantForkError import from all three routers (now handled by handle_git_exceptions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@junaway junaway marked this pull request as ready for review May 29, 2026 15:52
Copilot AI review requested due to automatic review settings May 29, 2026 15:52
@dosubot dosubot Bot added the tests label May 29, 2026
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

Refactor of the six revisioned services (workflows, applications, evaluators, environments, queries, testsets) to thread a new RetrievalInfo (third element of the return tuple) alongside the existing (revision, resolution_info). Environment-backed lookups now merge environment + target references inside the service, removing a duplicate retrieve_environment_revision call in the routers. retrieval_info is exposed on /revisions/retrieve and /revisions/resolve responses for all six entities. The SDK resolver middleware learns a resolve_references_with_info variant that merges returned references into the tracing context.

Changes:

  • Move RetrievalInfo DTO into core/git, add build_retrieval_info / revision_references utilities, and add retrieval_info fields to the relevant FastAPI response models.
  • Update all six services and their routers (plus legacy-variants pass-throughs) to produce/consume the 3-tuple, and add retrieve_query_revision / retrieve_testset_revision wrappers.
  • Extend SDK resolver middleware to merge server-provided retrieval references into TracingContext, and add unit + acceptance tests across all six entities.

Reviewed changes

Copilot reviewed 39 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
api/oss/src/core/git/dtos.py Adds RetrievalInfo DTO with references + key.
api/oss/src/core/git/utils.py New build_retrieval_info / revision_references helpers.
api/oss/src/core/workflows/service.py Returns (revision, resolution_info, retrieval_info); merges env refs when env-backed.
api/oss/src/core/applications/service.py Same triple-tuple refactor for applications.
api/oss/src/core/evaluators/service.py Same triple-tuple refactor for evaluators.
api/oss/src/core/environments/service.py Returns triple and removes stale commented log.
api/oss/src/core/queries/service.py New retrieve_query_revision wrapper emitting retrieval_info.
api/oss/src/core/testsets/service.py New retrieve_testset_revision wrapper emitting retrieval_info.
api/oss/src/apis/fastapi/{workflows,applications,evaluators,environments,queries,testsets}/router.py Pass retrieval_info through; resolve endpoints synthesize it via build_retrieval_info.
api/oss/src/apis/fastapi/{workflows,applications,evaluators,environments,queries,testsets}/models.py Add retrieval_info field to response models.
api/oss/src/apis/fastapi/legacy_variants/router.py Updated all unpacks to the 3-tuple shape.
sdks/python/agenta/sdk/middlewares/running/resolver.py New resolve_references_with_info + _merge_tracing_references; existing resolve_references becomes a thin wrapper.
api/oss/tests/pytest/unit/git/test_retrieval_info_utils.py Unit tests for helper merging and key handling.
api/oss/tests/pytest/unit/{applications,evaluators,environments,workflows,queries,testsets}/test_retrieve_resolve.py (+ test_router.py, test_flag_ownership.py) New/updated service-level unit tests covering direct + env-backed paths.
api/oss/tests/pytest/unit/legacy_variants/test_configs_fetch.py Updated mock return values to 3-tuple.
api/oss/tests/pytest/acceptance/{applications,evaluators,environments,workflows,queries,testsets}/test_*_retrieval_info.py End-to-end acceptance coverage for the new field.
sdks/python/oss/tests/pytest/utils/test_resolver_middleware.py Asserts retrieval references are merged onto the tracing context.

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

@junaway junaway marked this pull request as draft May 29, 2026 16:05
@junaway junaway marked this pull request as ready for review May 29, 2026 16:06
Copilot AI review requested due to automatic review settings May 29, 2026 16:06
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

Copilot reviewed 39 out of 45 changed files in this pull request and generated no new comments.

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

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

Comment thread api/oss/tests/pytest/unit/workflows/test_retrieve_resolve.py Outdated
Comment thread api/oss/src/core/invocations/service.py
@junaway
Copy link
Copy Markdown
Contributor

junaway commented May 30, 2026

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Copilot reviewed 66 out of 72 changed files in this pull request and generated 1 comment.

Comment thread api/oss/src/core/evaluations/tasks/legacy.py Outdated
junaway and others added 2 commits May 30, 2026 15:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
api/oss/src/apis/fastapi/evaluators/router.py (1)

1403-1409: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Emit evaluator revision events under the evaluator domain.

These handlers now publish domain="workflow", so evaluator retrieve/fetch/query/log events will be misclassified by any downstream audit, analytics, or filtering that keys off the domain.

Suggested fix
-            domain="workflow",
+            domain="evaluator",

Also applies to: 1489-1495, 1658-1664, 1737-1743

api/oss/src/core/annotations/service.py (1)

93-103: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pass environment-backed refs into evaluator retrieval.

Both calls only forward evaluator* refs. That breaks the new environment-backed path: create() can miss the intended evaluator and fall back to creating a new simple evaluator, and edit() can still validate against the existing annotation's evaluator instead of the refs supplied in annotation_edit.references.

Suggested fix
-        (
-            evaluator_revision,
-            _,
-            retrieval_info,
-        ) = await self.evaluators_service.retrieve_evaluator_revision(
-            project_id=project_id,
-            #
-            evaluator_ref=annotation.references.evaluator,
-            evaluator_variant_ref=annotation.references.evaluator_variant,
-            evaluator_revision_ref=annotation.references.evaluator_revision,
-        )
+        effective_references = annotation_edit.references or annotation.references
+        (
+            evaluator_revision,
+            _,
+            retrieval_info,
+        ) = await self.evaluators_service.retrieve_evaluator_revision(
+            project_id=project_id,
+            #
+            environment_ref=effective_references.environment,
+            environment_variant_ref=effective_references.environment_variant,
+            environment_revision_ref=effective_references.environment_revision,
+            key=(
+                effective_references.selector.get("key")
+                if effective_references.selector
+                else None
+            ),
+            #
+            evaluator_ref=effective_references.evaluator,
+            evaluator_variant_ref=effective_references.evaluator_variant,
+            evaluator_revision_ref=effective_references.evaluator_revision,
+        )

Apply the same environment/selector forwarding in create(...) using annotation_create.references.

Also applies to: 302-312

web/packages/agenta-entities/src/annotation/core/types.ts (1)

94-108: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Remove duplicate evaluator_variant property.

The evaluator_variant property is defined twice in the UpdateAnnotationPayload.annotation.references interface (lines 100 and 104). TypeScript will silently accept this but it's redundant and likely unintentional.

🐛 Proposed fix to remove duplicate property
         references?: {
             evaluator: {id?: string; slug?: string}
             evaluator_variant?: {id?: string; slug?: string}
             evaluator_revision?: {id?: string; slug?: string; version?: string | number}
             testset?: {id?: string}
             testcase?: {id?: string}
-            evaluator_variant?: {id?: string; slug?: string}
         }
🧹 Nitpick comments (2)
api/oss/tests/pytest/unit/annotations/test_annotations_service.py (1)

34-38: ⚡ Quick win

Add a retrieval-info case to this test.

This mock still returns (revision, None, None), so the new retrieval_info.references / retrieval_info.selector merge path in AnnotationsService.edit is never exercised here.

api/oss/src/core/tracing/utils/attributes.py (1)

266-269: 💤 Low value

Run ruff format to ensure consistent formatting.

The reformatting of model_dump() arguments should be validated by running ruff format and ruff check --fix from the API folder. As per coding guidelines, run ruff format then ruff check after making changes to API code.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: acc5fcbd-3d4b-4c5f-9d98-835ccd6bc2a4

📥 Commits

Reviewing files that changed from the base of the PR and between 216e551 and 94ad84f.

📒 Files selected for processing (57)
  • api/oss/src/apis/fastapi/applications/router.py
  • api/oss/src/apis/fastapi/environments/router.py
  • api/oss/src/apis/fastapi/evaluators/router.py
  • api/oss/src/apis/fastapi/queries/router.py
  • api/oss/src/apis/fastapi/testsets/router.py
  • api/oss/src/apis/fastapi/workflows/router.py
  • api/oss/src/core/annotations/service.py
  • api/oss/src/core/applications/service.py
  • api/oss/src/core/environments/service.py
  • api/oss/src/core/evaluations/tasks/legacy.py
  • api/oss/src/core/evaluations/tasks/live.py
  • api/oss/src/core/evaluators/service.py
  • api/oss/src/core/git/dtos.py
  • api/oss/src/core/git/utils.py
  • api/oss/src/core/invocations/service.py
  • api/oss/src/core/queries/service.py
  • api/oss/src/core/test_plan_reference_enrichment.md
  • api/oss/src/core/testsets/service.py
  • api/oss/src/core/tracing/dtos.py
  • api/oss/src/core/tracing/utils/attributes.py
  • api/oss/src/core/workflows/service.py
  • api/oss/src/services/llm_apps_service.py
  • api/oss/tests/pytest/acceptance/applications/test_application_retrieval_info.py
  • api/oss/tests/pytest/acceptance/environments/test_environment_retrieval_info.py
  • api/oss/tests/pytest/acceptance/evaluators/test_evaluator_retrieval_info.py
  • api/oss/tests/pytest/acceptance/queries/test_query_retrieval_info.py
  • api/oss/tests/pytest/acceptance/testsets/test_testset_retrieval_info.py
  • api/oss/tests/pytest/acceptance/workflows/test_workflow_retrieval_info.py
  • api/oss/tests/pytest/unit/annotations/test_annotations_service.py
  • api/oss/tests/pytest/unit/applications/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/applications/test_router.py
  • api/oss/tests/pytest/unit/environments/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/evaluators/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/git/test_retrieval_info_utils.py
  • api/oss/tests/pytest/unit/queries/test_retrieve.py
  • api/oss/tests/pytest/unit/test_llm_apps_service.py
  • api/oss/tests/pytest/unit/testsets/test_retrieve.py
  • api/oss/tests/pytest/unit/tracing/utils/test_attributes.py
  • api/oss/tests/pytest/unit/workflows/test_retrieve_resolve.py
  • sdks/python/agenta/sdk/contexts/tracing.py
  • sdks/python/agenta/sdk/decorators/tracing.py
  • sdks/python/agenta/sdk/engines/tracing/processors.py
  • sdks/python/agenta/sdk/middlewares/running/resolver.py
  • sdks/python/agenta/sdk/models/tracing.py
  • sdks/python/oss/tests/pytest/utils/test_resolver_middleware.py
  • sdks/python/oss/tests/pytest/utils/test_selector_span_attribute.py
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/transforms.ts
  • web/packages/agenta-annotation/src/state/controllers/annotationFormController.ts
  • web/packages/agenta-entities/src/annotation/core/types.ts
  • web/packages/agenta-entities/src/evaluationRun/core/schema.ts
  • web/packages/agenta-entities/src/runnable/index.ts
  • web/packages/agenta-entities/src/workflow/state/appUtils.ts
  • web/packages/agenta-entities/src/workflow/state/commit.ts
  • web/packages/agenta-entities/src/workflow/state/runnableSetup.ts
  • web/packages/agenta-entities/src/workflow/state/store.ts
  • web/packages/agenta-entity-ui/src/adapters/variantAdapters.ts
  • web/packages/agenta-playground/src/state/execution/executionRunner.ts
🚧 Files skipped from review as they are similar to previous changes (24)
  • api/oss/tests/pytest/unit/testsets/test_retrieve.py
  • api/oss/tests/pytest/acceptance/testsets/test_testset_retrieval_info.py
  • api/oss/tests/pytest/acceptance/environments/test_environment_retrieval_info.py
  • api/oss/tests/pytest/acceptance/queries/test_query_retrieval_info.py
  • api/oss/tests/pytest/unit/queries/test_retrieve.py
  • api/oss/src/apis/fastapi/environments/router.py
  • api/oss/src/core/git/utils.py
  • api/oss/src/apis/fastapi/queries/router.py
  • api/oss/tests/pytest/acceptance/workflows/test_workflow_retrieval_info.py
  • api/oss/tests/pytest/acceptance/applications/test_application_retrieval_info.py
  • api/oss/tests/pytest/unit/applications/test_router.py
  • api/oss/tests/pytest/unit/environments/test_retrieve_resolve.py
  • api/oss/src/core/queries/service.py
  • api/oss/tests/pytest/unit/git/test_retrieval_info_utils.py
  • api/oss/src/core/evaluators/service.py
  • api/oss/src/core/applications/service.py
  • api/oss/src/apis/fastapi/applications/router.py
  • api/oss/src/apis/fastapi/workflows/router.py
  • api/oss/src/core/testsets/service.py
  • api/oss/tests/pytest/unit/workflows/test_retrieve_resolve.py
  • api/oss/src/apis/fastapi/testsets/router.py
  • api/oss/tests/pytest/unit/applications/test_retrieve_resolve.py
  • api/oss/tests/pytest/unit/evaluators/test_retrieve_resolve.py
  • api/oss/src/core/workflows/service.py

Comment thread sdks/python/agenta/sdk/middlewares/running/resolver.py
Comment thread web/packages/agenta-entities/src/workflow/state/runnableSetup.ts
Comment thread web/packages/agenta-entities/src/workflow/state/runnableSetup.ts
@junaway junaway merged commit 29c882b into release/v0.100.8 May 31, 2026
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend refactoring A code change that neither fixes a bug nor adds a feature size:XL This PR changes 500-999 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants