Skip to content

harness-sdk

v1.16.0 Feature

This release adds 3 notable features for engineering teams evaluating rollout.

✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

agentic agentic-ai agents ai anthropic autonomous-agents
+13 more
bedrock genai litellm llama llm machine-learning mcp multi-agent-systems ollama openai opentelemetry python strands-agents

Summary

AI summary

Broad release touches All changes, Major Features, Major Bug Fixes, and models.

Full changelog

Major Features

Async Hooks Support - PR#1119

Hooks now support asynchronous callbacks, allowing your hook code to run concurrently with other async tasks without blocking the event loop. This is particularly beneficial for async agent invocations and scenarios where hooks perform I/O operations.

import asyncio
from strands import Agent
from strands.hooks import BeforeInvocationEvent, HookProvider, HookRegistry

class AsyncHook(HookProvider):
    def register_hooks(self, registry: HookRegistry, **kwargs) -> None:
        registry.add_callback(BeforeInvocationEvent, self.async_callback)

    async def async_callback(self, event: BeforeInvocationEvent) -> None:
        # Perform async operations without blocking the event loop
        await asyncio.sleep(1)
        print("Hook executed asynchronously!")

agent = Agent(hooks=[AsyncHook()])
await agent.invoke_async("Hello!")

Thread Context Sharing - PR#1146

Context variables (contextvars) are now automatically copied from the main thread to agent threads when using synchronous invocations. This ensures that context-dependent tools and hooks work correctly.

from contextvars import ContextVar
from strands import Agent, tool

request_id = ContextVar('request_id')

@tool
def my_tool():
    # Context variables are now accessible within tools
    current_request_id = request_id.get()
    return f"Processing request: {current_request_id}"

request_id.set("abc-123")
agent = Agent(tools=[my_tool])
response = agent.invoke_async("Use my tool")  # Context is properly propagated

Enhanced Telemetry with Tool Definitions - PR#1113

Tool definitions are now included in OpenTelemetry traces via semantic convention opt-in, providing better observability into agent tool usage, following the OpenTelemetry semantic conventions for GenAI.

Opt-in via environment variable:

OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_tool_definitions
from strands import Agent, tool
from strands_tools import calculator

# Tool definition will appear in telemetry traces
agent = Agent(tools=[calculator])
agent("What is 5 + 3?")

String Descriptions in Annotated Tool Parameters - PR#1089

You can now use simple string descriptions directly in Annotated type hints for tool parameters, improving code readability and reducing boilerplate.

from typing import Annotated
from strands import tool

@tool
def get_weather(
    location: Annotated[str, "The city and state, e.g., San Francisco, CA"],
    units: Annotated[str, "Temperature units: 'celsius' or 'fahrenheit'"] = "celsius"
):
    """Get weather for a location."""
    return f"Weather in {location}: 72°{units[0].upper()}"

# Previously required more verbose Field() syntax or using a doc-string

Major Bug Fixes

  • Anthropic "Prompt Too Long" Error Handling - PR#1137
    The SDK now properly handles and surfaces Anthropic's "prompt is too long" errors, making it easier to diagnose and fix context window issues.
  • MCP Server 5xx Error Resilience - PR#1169
    The SDK no longer hangs when Model Context Protocol (MCP) servers return 5xx errors, improving reliability when working with external services.
  • Gemini Non-JSON Error Message Handling - PR#1062
    The Gemini model provider now gracefully handles non-JSON error responses, preventing unexpected crashes.

All changes

  • fix(models/gemini): handle non-JSON error messages from Gemini API by @Ratish1 in https://github.com/strands-agents/sdk-python/pull/1062
  • fix: Handle "prompt is too long" from Anthropic by @zastrowm in https://github.com/strands-agents/sdk-python/pull/1137
  • feat(telemetry): Add tool definitions to traces via semconv opt-in by @Ratish1 in https://github.com/strands-agents/sdk-python/pull/1113
  • fix: Strip argument sections out of inputSpec top-level description by @zastrowm in https://github.com/strands-agents/sdk-python/pull/1142
  • share thread context by @pgrayy in https://github.com/strands-agents/sdk-python/pull/1146
  • async hooks by @pgrayy in https://github.com/strands-agents/sdk-python/pull/1119
  • feat(tools): Support string descriptions in Annotated parameters by @Ratish1 in https://github.com/strands-agents/sdk-python/pull/1089
  • chore(telemetry): updated opt-in attributes to internal by @poshinchen in https://github.com/strands-agents/sdk-python/pull/1152
  • feat(models): allow SystemContentBlocks in LiteLLMModel by @dbschmigelski in https://github.com/strands-agents/sdk-python/pull/1141
  • share interrupt state by @pgrayy in https://github.com/strands-agents/sdk-python/pull/1148
  • fix: Don't hang when MCP server returns 5xx by @zastrowm in https://github.com/strands-agents/sdk-python/pull/1169
  • fix(models): allow setter on system_prompt and system_prompt_content by @dbschmigelski in https://github.com/strands-agents/sdk-python/pull/1171

Full Changelog: https://github.com/strands-agents/sdk-python/compare/v1.15.0...v1.16.0

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track harness-sdk

Get notified when new releases ship.

Sign up free

About harness-sdk

A model-driven approach to building AI agents in just a few lines of code.

All releases →

Related context

Beta — feedback welcome: [email protected]