Skip to content

Agent Connector 4.3.0: Add sema4_api_url, batch work items, Snowflake support#272

Merged
raivolink merged 5 commits into
mainfrom
agent-connector/4.3.0-sema4-api-url
May 5, 2026
Merged

Agent Connector 4.3.0: Add sema4_api_url, batch work items, Snowflake support#272
raivolink merged 5 commits into
mainfrom
agent-connector/4.3.0-sema4-api-url

Conversation

@mikahanninen
Copy link
Copy Markdown
Contributor

Summary

  • Add sema4_api_url Secret parameter to all actions, enabling explicit API URL configuration (replaces implicit local-only detection)
  • Add create_work_items_for_agent() action for batch-creating multiple Work Items in a single call
  • Add get_current_conversation_id() action to expose the current thread ID for passing to worker agents
  • Add Snowflake deployment support: URL normalisation and Snowflake Token auth header for snowflakecomputing endpoints
  • Remove work_item_api_url parameter from create_work_item_for_agent() — URL is now derived from sema4_api_url
  • Refactor auth header logic into _get_auth_header() helper used consistently across all request paths
  • Fix: remove debug prints and a raise AgentApiClientException that was accidentally left in request()

Test plan

  • ask_agent() works with sema4_api_url=LOCAL (local Studio/SDK)
  • ask_agent() works with an explicit cloud URL
  • create_work_items_for_agent() creates one work item per entry in the JSON array
  • get_current_conversation_id() returns the current thread ID
  • Snowflake endpoint receives Snowflake Token auth header
  • When SEMA4AI_API_V1_URL env var is set, explicit URL is ignored

🤖 Generated with Claude Code

…wflake support

- Add sema4_api_url Secret to all actions for explicit API URL configuration
- Add create_work_items_for_agent() for batch Work Item creation
- Add get_current_conversation_id() to expose thread ID to worker agents
- Add Snowflake deployment support with URL normalisation and token auth
- Remove work_item_api_url param from create_work_item_for_agent() (derived from sema4_api_url)
- Refactor auth header logic into _get_auth_header() helper
- Remove debug prints and raise statement left in request() method

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mikahanninen mikahanninen requested a review from ovatto March 20, 2026 09:58
mikahanninen and others added 4 commits March 20, 2026 12:01
- Document sema4_api_url Secret parameter and authentication table
- Add Snowflake environment instructions
- Add create_work_items_for_agent batch usage example
- Add get_current_conversation_id usage example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eployments

- Try both trailing-slash variants of v2 and v1 work-item URLs so the
  action works across local (Python server requires slash), Snowflake,
  and cloud Express (rejects trailing slash) without manual configuration
- Fix _request_with_base_url to not append a trailing slash when path
  is empty, preventing spurious slash on the creation POST
- Update README to clarify that cloud deployments require the full
  tenant-scoped workspace URL (including /tenants/{id}/) for work-item
  creation to succeed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@raivolink raivolink left a comment

Choose a reason for hiding this comment

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

LGTM

@raivolink raivolink merged commit 03b55ae into main May 5, 2026
7 checks passed
@raivolink raivolink deleted the agent-connector/4.3.0-sema4-api-url branch May 5, 2026 16:52
@playerzero-ai
Copy link
Copy Markdown

playerzero-ai Bot commented May 5, 2026

agents + PlayerZero

Simulations

Project Branch Status Updated (UTC)
agents agent-connector/4.3.0-sema4-api-urlmain Simulating Simulating May 05 @ 04:54 PM UTC

Change Summary

Summary

Purpose

Makes API URL configuration explicit and adds comprehensive Snowflake deployment support to the Agent Connector action package, enabling agent orchestration and batch work-item processing across different runtime environments.

Key Changes

API Configuration

  • Added sema4_api_url Secret parameter to all 9 actions (previously inferred)
  • Introduced _make_client() helper to consolidate client instantiation with both api_key and api_url
  • Removed hardcoded work_item_api_url parameter from create_work_item_for_agent() — now derived from sema4_api_url

Snowflake Deployment Support

  • Detects Snowflake endpoints via URL pattern matching (snowflakecomputing)
  • Auto-detects via SEMA4AI_API_V1_URL environment variable (Snowpark Container Services)
  • URL normalization to ensure /api/v1 or /api/v2 format for Snowflake endpoints
  • Environment-aware authentication headers:
    • Snowflake: Authorization: Snowflake Token="..."
    • Cloud/Default: Authorization: Bearer ...
    • Local: No authentication

New Actions

  • get_current_conversation_id() — Returns thread ID for agent orchestration patterns (enables worker agents to callback to parent conversations)
  • create_work_items_for_agent() — Batch work-item creation from JSON array; each item includes message, payload, and optional attachments; message auto-merges into payload

Robustness Improvements

  • Work-item API fallback logic now tries both v1 and v2 endpoints, plus trailing/non-trailing slash variants (accommodates local Python server vs. cloud Express servers)
  • JSON parsing with detailed error messages and validation
  • Improved error handling in response parsing

Dependencies

  • No external dependency changes
  • Depends on sema4ai.actions.agent.get_thread_id for retrieving current conversation context
  • Integrates with existing work-item, conversation, and agent APIs

Version

4.2.1 → 4.3.1

View more in PlayerZero
updated: May 05 @ 04:54 PM UTC

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants