Skip to content

release: 0.9.10#312

Merged
stainless-app[bot] merged 5 commits intomainfrom
release-please--branches--main--changes--next
Apr 7, 2026
Merged

release: 0.9.10#312
stainless-app[bot] merged 5 commits intomainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app
Copy link
Copy Markdown
Contributor

@stainless-app stainless-app Bot commented Apr 7, 2026

Automated Release PR

0.9.10 (2026-04-07)

Full Changelog: v0.9.9...v0.9.10

Features

  • adk: Revamp run_claude_agent_activity to use more streaming (#309) (25069d3)

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 release bumps the version to 0.9.10 and revamps run_claude_agent_activity to use streaming for all content block types (text, thinking, tool use), with tool results handled via a new TemporalStreamingHooks class with pre/post hook callbacks. The cost_info None guard (previously flagged) is correctly implemented on line 382.

  • The success path after the message loop does not clean up any remaining subagent_spans (unlike the error path which does) — if a Task tool starts a span but its PostToolUse hook never fires, those spans will be abandoned on a clean exit.

Confidence Score: 4/5

Safe to merge; one minor cleanup gap on the success path

All findings are P2. The subagent span leak on success depends on an edge-case SDK behavior (PostToolUse not firing after a Task tool call) and won't cause data loss or incorrect results, but the success path should mirror the error path's cleanup for robustness.

src/agentex/lib/core/temporal/plugins/claude_agents/activities.py — success-path cleanup around line 397

Important Files Changed

Filename Overview
src/agentex/lib/core/temporal/plugins/claude_agents/activities.py Revamped streaming activity handling TextBlock/ThinkingBlock/ToolUseBlock; subagent spans not cleaned up on normal success path
src/agentex/lib/core/temporal/plugins/claude_agents/hooks/hooks.py New TemporalStreamingHooks class with pre/post tool use hooks for streaming tool events; logic is correct
tests/lib/test_claude_agents_activities.py Comprehensive tests for activity helpers and message handling; all key scenarios covered
tests/lib/test_claude_agents_hooks.py Good coverage of all three hook methods and the factory function
src/agentex/_version.py Version bump to 0.9.10
pyproject.toml Version bump to 0.9.10

Sequence Diagram

sequenceDiagram
    participant W as Temporal Workflow
    participant A as run_claude_agent_activity
    participant SDK as ClaudeSDKClient
    participant H as TemporalStreamingHooks
    participant UI as AgentEx UI

    W->>A: execute_activity(prompt, workspace, tools)
    A->>SDK: async with ClaudeSDKClient(options)
    A->>SDK: client.query(prompt)
    loop receive_response()
        SDK-->>A: AssistantMessage(TextBlock)
        A->>UI: stream_text_delta()
        SDK-->>A: AssistantMessage(ThinkingBlock)
        A->>UI: stream_reasoning()
        SDK-->>A: AssistantMessage(ToolUseBlock)
        A->>UI: stream_tool_request()
        Note over A: opens subagent span if Task tool
        SDK-->>H: PostToolUse hook
        H->>UI: stream tool response
        Note over H: closes subagent span
        SDK-->>A: SystemMessage(init)
        A->>A: capture session_id
        SDK-->>A: ResultMessage
        A->>A: capture cost/usage
    end
    A->>A: close_text_stream()
    Note over A: subagent_spans NOT cleaned up here
    A-->>W: {messages, session_id, usage, cost_usd}
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agentex/lib/core/temporal/plugins/claude_agents/activities.py
Line: 396-398

Comment:
**Orphaned subagent spans not cleaned up on success path**

The `subagent_spans` dict is fully cleaned up in the `except` block (lines 412–417), but the normal success path calls `close_text_stream()` and returns without touching it. If a `Task` tool use opens a span in `stream_tool_request` and the SDK completes the session without firing `PostToolUse` (e.g., a partial response or SDK-level soft termination that doesn't raise a Python exception), those span context managers are abandoned. The success path should mirror the error path:

```suggestion
        logger.debug("Message loop completed, cleaning up...")
        await close_text_stream()
        for _ctx, _span in list(subagent_spans.values()):
            try:
                await _ctx.__aexit__(None, None, None)
            except Exception:
                pass
        subagent_spans.clear()
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (3): Last reviewed commit: "release: 0.9.10" | Re-trigger Greptile

@declan-scale declan-scale changed the title release: 0.10.0 release: 0.9.10 Apr 7, 2026
@stainless-app
Copy link
Copy Markdown
Contributor Author

stainless-app Bot commented Apr 7, 2026

Release version edited manually

The Pull Request version has been manually set to 0.9.10 and will be used for the release.

If you instead want to use the version number 0.10.0 generated from conventional commits, just remove the label autorelease: custom version from this Pull Request.

@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from b7946ad to e873bba Compare April 7, 2026 20:03
Comment thread src/agentex/lib/core/temporal/plugins/claude_agents/activities.py Outdated
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from e873bba to c752366 Compare April 7, 2026 20:19
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from c752366 to 6249002 Compare April 7, 2026 21:18
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 6249002 to 6de71ad Compare April 7, 2026 21:19
@stainless-app stainless-app Bot merged commit 8ed8786 into main Apr 7, 2026
32 checks passed
@stainless-app stainless-app Bot deleted the release-please--branches--main--changes--next branch April 7, 2026 21:27
@stainless-app
Copy link
Copy Markdown
Contributor Author

stainless-app Bot commented Apr 7, 2026

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