Skip to content

feat: AgentClient for calling one agent through the Agent Execution API - #116

Merged
chaliy merged 4 commits into
mainfrom
claude/project-thread-vpmz60
Oct 10, 2026
Merged

chaliy merged 4 commits into
mainfrom
claude/project-thread-vpmz60

Conversation

@chaliy

@chaliy chaliy commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New AgentClient in Rust, Python and TypeScript. It calls one agent through its agent URL with an agent key (evr_ak_…) or another channel credential, and never reaches the management API. It reads EVERRUNS_AGENT_URL and EVERRUNS_AGENT_KEY.
  • What it covers: the agent card, sessions, messages, cancel, events, the SSE stream with the existing reconnect rules, answers to questions, tool approvals, and runtime_token.
  • Two helpers on top of the routes:
    • run(text, session_id?) sends a message and returns the agent's reply.
    • for_end_user / forEndUser gives a derived client that sends End-User on every request.
  • Safe retries: idempotency_key passes through as the Idempotency-Key header.
  • Same routes on both hosts: the everruns server (/v1/channels/{channel_id}) and serve apps (/v1/channels/{agent}) answer the same routes. This matches upstream everruns#4419, #4438, #4490, #4511 and #4514.
  • Management client: its session create and message create now point callers to AgentClient.
    • Python warns once with DeprecationWarning.
    • TypeScript marks them @deprecated.
    • Rust gets a doc note, without #[deprecated], so existing -D warnings builds keep compiling.
  • Naming: the client is AgentClient because Agent is already the management model type.
  • Docs: the design is written up in specs/agent-client.md. Each README now opens with "Call your agent from code", and each language has an example and a cookbook entry that run against a real agent.

Test Plan

New mock-server tests in each language cover:

  • the bearer header, and End-User sent only on the derived client
  • Idempotency-Key pass-through
  • URL joining, with and without a trailing slash
  • errors 401, 403, 404, 422 (with code) and 429
  • every route
  • run on a new session, on an existing session (it streams after the newest sequence, so earlier turns are not replayed), and on turn.failed

Results:

  • Python: 203 passed, 17 of them new.
  • TypeScript: 190 passed, 25 of them new.
  • Rust: all suites passed, including 14 new wiremock tests and the doctests.

just lint, just test and just pre-push pass. The examples were not run against a live agent.

  • Tests pass locally
  • Coverage ≥80%
  • Linting passes

Checklist

  • Follows SDK API consistency guidelines
  • Updated relevant specs (if applicable)
  • Added/updated tests
  • Updated documentation (if applicable)

Generated by Claude Code

@chaliy
chaliy merged commit c433ebc into main Oct 10, 2026
13 checks passed
@chaliy
chaliy deleted the claude/project-thread-vpmz60 branch October 10, 2026 19:33
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.

1 participant