Skip to content

[feat] Extend loadables#3811

Open
jp-agenta wants to merge 185 commits intorelease/v0.87.3from
feat/extend-loadables-in-api
Open

[feat] Extend loadables#3811
jp-agenta wants to merge 185 commits intorelease/v0.87.3from
feat/extend-loadables-in-api

Conversation

@jp-agenta
Copy link
Member

@jp-agenta jp-agenta commented Feb 23, 2026

PR: Loadables Retrieval Alignment

Summary

This PR aligns loadables retrieval behavior across testsets/queries, removes stale design drift in docs, and makes the traces router a first-class traces API (no tracing-shaped response types in traces endpoints).

Change Inventory

API: Testsets

  1. Fixed _populate_testcases(...) call-site argument binding bugs by switching to keyword arguments.
  2. Added deterministic ID-level windowing support for testset revision retrieval (order, next, limit) when enumerating testcase_ids.
  3. Kept revision retrieval semantics where include_testcases=true returns both testcases and testcase_ids.
  4. Updated /preview/testsets/revisions/retrieve caching policy to cache only when include_testcases=false.

API: Queries

  1. Extended query revision population to merge request pagination (next, limit) into stored windowing.
  2. Kept revision retrieval semantics where trace expansion can return both traces and trace_ids.
  3. Updated /preview/queries/revisions/retrieve caching policy to cache only when both include_trace_ids=false and include_traces=false.
  4. Added permission coupling: query revision retrieve with trace expansion requires trace-view permission in addition to query-view permission.

API: Traces Router

  1. Introduced traces-specific DTOs:
    • TraceResponse
    • TracesResponse
    • TracesQueryRequest
  2. Removed formatting from TracesQueryRequest.
  3. Forced /preview/traces/query to always return Agenta trace trees (never spans/opentelemetry formatting).
  4. Removed external TracingQuery request contract from TracesRouter.query_traces; traces endpoint now consumes only TracesQueryRequest.
  5. Added query permission coupling for ref-dereferenced traces query (query_ref, query_variant_ref, query_revision_ref).
  6. Added native traces router fetch handler (GET /preview/traces/{trace_id}) returning TraceResponse.

Docs

  1. Updated docs/designs/loadables/loadables.querying.strategies.md to include:
    • include-flag defaults
    • conditional caching behavior
    • permission coupling notes
    • windowing.next terminology
  2. Updated docs/designs/loadables/loadables.initial.specs.md examples from cursor to next.
  3. Removed redundant docs/designs/loadables/loadables.querying.gap-analysis.md after consolidating its useful content into the strategies document.

Behavior Summary

  1. Revision endpoints remain the control surface for ID/item expansion.
  2. Record endpoints (/preview/testcases, /preview/traces) remain record-returning endpoints without extra top-level ID arrays.
  3. Traces router now has a clean traces-only contract and response types.

Validation

  1. Formatting/lint:
    • cd api && ruff format && ruff check --fix
  2. Targeted e2e:
    • pytest -q oss/tests/pytest/e2e/tracing/test_traces_basics.py oss/tests/pytest/e2e/loadables/test_loadable_strategies.py
    • Result: 27 passed
  3. Broader e2e:
    • pytest -q oss/tests/pytest/e2e/testsets/test_testsets_basics.py oss/tests/pytest/e2e/testsets/test_testsets_queries.py oss/tests/pytest/e2e/testsets/test_testcases_basics.py oss/tests/pytest/e2e/tracing/test_spans_basics.py oss/tests/pytest/e2e/tracing/test_spans_queries.py
    • Result: 17 passed, 3 skipped (existing flaky skips)
  4. Full e2e suite:
    • pytest -q oss/tests/pytest/e2e
    • Result: 175 passed, 3 skipped

Open with Devin

ashrafchowdury and others added 27 commits February 5, 2026 18:09
- context.md: background, current state analysis, problem statement
- prd.md: product requirements with 4 capabilities, user stories, acceptance criteria
- research.md: analysis of current EvaluationQueue implementation
- rfc.md: technical RFC with two solution options (extend runs vs new domain)
- competitive-analysis.md: anonymized analysis of competitor's approach
- rfc.md: added Solution C using metadata-based queues (no new tables)
- Updated recommendation: Solution C for v1 (1-2 weeks vs 4-5 weeks)

Key insight: annotations and review status can be stored as metadata
on existing items, with queues as filtered views rather than entities.
…re/webhooks

# Conflicts:
#	api/entrypoints/routers.py
#	api/oss/src/routers/variants_router.py
@vercel
Copy link

vercel bot commented Feb 23, 2026

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Mar 3, 2026 4:57pm

Request Review

@jp-agenta jp-agenta requested a review from ardaerzin February 23, 2026 19:36
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 43 additional findings in Devin Review.

Open in Devin Review

junaway and others added 21 commits March 3, 2026 10:34
The TimestampModel and UserUpdate Pydantic models used
datetime.now(timezone.utc) evaluated at import time as the default
value for created_at/updated_at fields. This baked the server startup
timestamp into the OpenAPI schema, causing the daily docs CI to detect
spurious changes and create a new PR every run.
fix(ci): stop docs CI from creating daily phantom PRs
docs: add endoze as a contributor for infra, doc, and infra
[feat] Add `events` and `webhooks`
@CLAassistant
Copy link

CLAassistant commented Mar 3, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ mmabrouk
✅ jp-agenta
✅ junaway
❌ allcontributors[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

devin-ai-integration[bot]

This comment was marked as resolved.

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

Labels

Backend documentation Improvements or additions to documentation feature lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants