Skip to content

chore: release main#461

Open
stainless-app[bot] wants to merge 3 commits into
mainfrom
release-please--branches--main--changes--next
Open

chore: release main#461
stainless-app[bot] wants to merge 3 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app

@stainless-app stainless-app Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

✨ Stainless prepared a new release

agentex-client: 0.18.1

0.18.1 (2026-07-13)

Full Changelog: agentex-client-v0.18.0...agentex-client-v0.18.1

Bug Fixes

  • internal: resolve build failures (9245b70)
  • tracing: capture span body exceptions and export SGP status=ERROR (#460) (6c23d76)
agentex-sdk: 0.18.1

0.18.1 (2026-07-13)

Full Changelog: agentex-sdk-v0.18.0...agentex-sdk-v0.18.1

Chores

  • agentex-sdk: Synchronize agentex versions

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

Greptile Summary

This patch release (0.18.1) fixes two issues: a build failure resolved by adding -p . to the pyright invocation in scripts/lint, and a tracing gap where exceptions raised inside span context managers were silently swallowed with no error signal exported to SGP.

  • New span_error.py module: set_span_error stores {type, message} under the reserved data["__error__"] key (no-op for list-shaped data, mirroring the _add_source_to_span convention), and get_span_error retrieves it.
  • trace.py context managers updated: both Trace.span and AsyncTrace.span now catch Exception, call set_span_error, and re-raise so the span error is always recorded before end_span fires in finally.
  • sgp_tracing_processor._build_sgp_span updated: reads the recorded error via get_span_error and calls sgp_span.set_error(...) so spans that experienced an exception are exported with status=ERROR rather than SUCCESS.

Confidence Score: 5/5

Safe to merge — changes are well-scoped, additive, and covered by new tests.

The exception-capture path is straightforward: set_span_error mutates span.data before end_span serializes it, and the SGP processor correctly reads the error key on export. Error info is never lost because the except block runs before finally. No existing behaviour is altered for the happy path. Tests cover helpers, both sync/async context managers, and the SGP mapping layer.

No files require special attention.

Important Files Changed

Filename Overview
src/agentex/lib/core/tracing/span_error.py New module with set_span_error / get_span_error helpers; clean implementation with correct no-op for list-shaped data
src/agentex/lib/core/tracing/trace.py Sync and async span context managers now catch Exception, record error on span via set_span_error, and re-raise; end_span still fires in finally
src/agentex/lib/core/tracing/processors/sgp_tracing_processor.py _build_sgp_span now reads error via get_span_error and calls set_error on SGPSpan, correctly setting status=ERROR on export
tests/lib/core/tracing/test_span_error.py Good coverage: unit tests for helpers, sync/async context manager capture, and SGP mapping layer with a fake SGPSpan
scripts/lint Adds -p . to pyright invocation to resolve build failures by explicitly pointing to the local pyrightconfig.json
pyproject.toml Version bump agentex-client 0.18.0 → 0.18.1
adk/pyproject.toml Version bump agentex-sdk 0.18.0 → 0.18.1

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant Trace/AsyncTrace
    participant span_error
    participant SGPProcessor
    participant SGP

    Caller->>Trace/AsyncTrace: async/sync with trace.span("op") as span
    Trace/AsyncTrace->>Trace/AsyncTrace: start_span()
    Trace/AsyncTrace-->>Caller: yield span

    alt Exception raised in body
        Caller-->>Trace/AsyncTrace: raises Exception
        Trace/AsyncTrace->>span_error: set_span_error(span, exc)
        span_error->>span_error: "span.data["__error__"] = {type, message}"
        Trace/AsyncTrace-->>Caller: re-raise
    end

    Trace/AsyncTrace->>Trace/AsyncTrace: end_span() [finally]
    Trace/AsyncTrace->>SGPProcessor: on_span_end(span)
    SGPProcessor->>span_error: get_span_error(span)
    span_error-->>SGPProcessor: "{type, message} or None"
    alt Error present
        SGPProcessor->>SGPProcessor: sgp_span.set_error(error_type, error_message)
        note over SGPProcessor: status = ERROR
    end
    SGPProcessor->>SGP: upsert_batch(sgp_span)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant Trace/AsyncTrace
    participant span_error
    participant SGPProcessor
    participant SGP

    Caller->>Trace/AsyncTrace: async/sync with trace.span("op") as span
    Trace/AsyncTrace->>Trace/AsyncTrace: start_span()
    Trace/AsyncTrace-->>Caller: yield span

    alt Exception raised in body
        Caller-->>Trace/AsyncTrace: raises Exception
        Trace/AsyncTrace->>span_error: set_span_error(span, exc)
        span_error->>span_error: "span.data["__error__"] = {type, message}"
        Trace/AsyncTrace-->>Caller: re-raise
    end

    Trace/AsyncTrace->>Trace/AsyncTrace: end_span() [finally]
    Trace/AsyncTrace->>SGPProcessor: on_span_end(span)
    SGPProcessor->>span_error: get_span_error(span)
    span_error-->>SGPProcessor: "{type, message} or None"
    alt Error present
        SGPProcessor->>SGPProcessor: sgp_span.set_error(error_type, error_message)
        note over SGPProcessor: status = ERROR
    end
    SGPProcessor->>SGP: upsert_batch(sgp_span)
Loading

Reviews (2): Last reviewed commit: "chore: release main" | Re-trigger Greptile

#460)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 4266454 to bc499ed Compare July 13, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant