Skip to content

release: 0.12.0#350

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

release: 0.12.0#350
stainless-app[bot] wants to merge 8 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app
Copy link
Copy Markdown
Contributor

@stainless-app stainless-app Bot commented May 8, 2026

Automated Release PR

0.12.0 (2026-05-13)

Full Changelog: v0.11.0...v0.12.0

⚠ BREAKING CHANGES

  • remove AgentexTracingProcessor from default tracing processors (#349)

Features

  • internal/types: support eagerly validating pydantic iterators (2c528c6)
  • remove AgentexTracingProcessor from default tracing processors (#349) (73eca7a)
  • streaming: emit OTel metrics for ttft, tps, token counts (#347) (3bf7d1f)

Bug Fixes

  • client: add missing f-string prefix in file type error message (dcb1cb4)
  • render .env.example template in agentex init (#351) (6092595)
  • tracing: make SGP processor stateless to stop dropping span closes (#354) (5e9f28d)
  • wire SGP_CLIENT_BASE_URL and silence openai-agents tracer in templates (#352) (870324e)

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

  • Bumps to 0.12.0 with a breaking change: removes AgentexTracingProcessor from default tracing processors, requires users to explicitly register processors. Also fixes a long-standing cross-pod Temporal bug by making SGPSyncTracingProcessor and SGPAsyncTracingProcessor stateless — both processors now build and flush a complete span on start and end rather than caching state in a _spans dict that could be missing on a different pod.
  • Adds a new agentex.lib.core.observability module that emits OTel metrics (ttft, ttat, tps, token counters, request counts) from the streaming model path; cardinality is bounded to model and a small fixed status enum.
  • Fixes a missing f-string prefix in _files.py and introduces EagerIterable to eagerly validate pydantic iterators upfront, preventing the repeated-serialization data-loss bug.

Confidence Score: 4/5

Safe to merge after fixing the unconditional SGP registration in the temporal-openai-agents workflow template.

One P1 finding: workflow.py.j2 still registers the SGP tracing processor unconditionally without checking SGP_API_KEY/SGP_ACCOUNT_ID, unlike the sibling acp.py.j2. This was flagged in previous reviews and remains unfixed while this PR adds sgp_base_url to the same unconditional block. All other changes are well-implemented and tested.

src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2 — missing credential guard around add_tracing_processor_config.

Important Files Changed

Filename Overview
src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2 Adds set_tracing_disabled(True) and sgp_base_url wiring, but the add_tracing_processor_config call remains unconditional (no SGP_API_KEY/SGP_ACCOUNT_ID guard), unlike the sibling acp.py.j2 template.
src/agentex/lib/core/tracing/processors/sgp_tracing_processor.py Refactored both sync and async processors to be stateless — removes _spans dict and builds SGPSpan on both start and end via the new _build_sgp_span helper, fixing cross-pod Temporal span drops.
src/agentex/lib/core/observability/llm_metrics.py New OTel metrics module with bounded cardinality (only model and status tags); instruments are lazily created and the module is safe to import without a MeterProvider.
src/agentex/lib/core/observability/llm_metrics_hooks.py RunHooks adapter that records request counts and token counters; all metric emissions are wrapped in try/except to prevent hook failures from breaking the caller.
src/agentex/lib/core/temporal/plugins/openai_agents/models/temporal_streaming_model.py Adds perf_counter bookmarks for ttft, ttat, and tps metrics; records failure counter in the except block; stream_start_perf is correctly captured before the responses.create() await.
src/agentex/lib/core/tracing/tracing_processor_manager.py Removes AgentexTracingProcessor from default processors (breaking change documented in changelog) and removes associated lazy-init scaffolding.
src/agentex/_models.py Adds EagerIterable type alias that eagerly consumes and validates any Iterable[T] input upfront, fixing the Pydantic ValidatorIterator consumption bug on repeated serialization.
src/agentex/_files.py One-line bug fix: adds missing f-string prefix to error message so type(files) is interpolated rather than printed literally.
src/agentex/lib/cli/templates/sync-openai-agents/project/acp.py.j2 Adds set_tracing_disabled(True) to suppress native openai-agents tracer, and wires SGP_CLIENT_BASE_URL behind the existing credential guard.

Sequence Diagram

sequenceDiagram
    participant SM as TemporalStreamingModel
    participant Hooks as TemporalStreamingHooks(LLMMetricsHooks)
    participant Metrics as LLMMetrics (OTel)
    participant SGP as SGPAsyncTracingProcessor

    SM->>SM: "stream_start_perf = time.perf_counter()"
    SM->>SM: responses.create() [stream open]
    loop per delta event
        SM->>SM: bookmark first_token_at / last_token_at / first_answer_at
    end
    SM->>SGP: on_span_end(span) [stateless: build + upsert]
    SM->>Metrics: ttft_ms / ttat_ms / tps.record()
    SM->>Hooks: on_llm_end(response)
    Hooks->>Metrics: "requests.add(1, status=success)"
    Hooks->>Metrics: input_tokens / output_tokens / cached / reasoning .add()
    alt Exception raised
        SM->>Metrics: record_llm_failure(model, exc)
    end
Loading

Comments Outside Diff (1)

  1. src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2, line 42-50 (link)

    P1 The add_tracing_processor_config call is made unconditionally, regardless of whether SGP_API_KEY and SGP_ACCOUNT_ID are set. Users who generate this template without SGP credentials will still register a tracing processor that initialises SGPClient(api_key="", ...), producing auth errors on every trace event. The sibling acp.py.j2 template correctly guards this call — the same pattern should be applied here.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2
    Line: 42-50
    
    Comment:
    The `add_tracing_processor_config` call is made unconditionally, regardless of whether `SGP_API_KEY` and `SGP_ACCOUNT_ID` are set. Users who generate this template without SGP credentials will still register a tracing processor that initialises `SGPClient(api_key="", ...)`, producing auth errors on every trace event. The sibling `acp.py.j2` template correctly guards this call — the same pattern should be applied here.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Cursor Fix in Claude Code Fix in Codex

Fix All in Cursor Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2:42-50
The `add_tracing_processor_config` call is made unconditionally, regardless of whether `SGP_API_KEY` and `SGP_ACCOUNT_ID` are set. Users who generate this template without SGP credentials will still register a tracing processor that initialises `SGPClient(api_key="", ...)`, producing auth errors on every trace event. The sibling `acp.py.j2` template correctly guards this call — the same pattern should be applied here.

```suggestion
SGP_API_KEY = os.environ.get("SGP_API_KEY", "")
SGP_ACCOUNT_ID = os.environ.get("SGP_ACCOUNT_ID", "")
SGP_CLIENT_BASE_URL = os.environ.get("SGP_CLIENT_BASE_URL", "")

# Setup tracing for SGP (Scale GenAI Platform)
# This enables visibility into your agent's execution in the SGP dashboard
if SGP_API_KEY and SGP_ACCOUNT_ID:
    add_tracing_processor_config(
        SGPTracingProcessorConfig(
            sgp_api_key=SGP_API_KEY,
            sgp_account_id=SGP_ACCOUNT_ID,
            sgp_base_url=SGP_CLIENT_BASE_URL,
        )
    )
```

Reviews (7): Last reviewed commit: "release: 0.12.0" | Re-trigger Greptile

@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from cac40be to c646eb3 Compare May 8, 2026 18:27
…plates (#352)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from c646eb3 to 7ad5b19 Compare May 8, 2026 19:01
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 7ad5b19 to 5eaf474 Compare May 8, 2026 21:16
@stainless-app stainless-app Bot changed the title release: 0.11.1 release: 0.12.0 May 8, 2026
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 5eaf474 to ec02cb4 Compare May 8, 2026 21:16
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from ec02cb4 to 6d194bb Compare May 11, 2026 21:24
Pin all GitHub Actions referenced in generated workflows (both
first-party `actions/*` and third-party) to immutable commit SHAs.
Updating pinned actions is now a deliberate codegen-side bump rather
than implicit on every workflow run.
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 6d194bb to c47090f Compare May 12, 2026 19:06
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from c47090f to 30aadb9 Compare May 13, 2026 12:36
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.

3 participants