Skip to content

Add Ruby agents support and shared playback integration tests - #29

Merged
NicholasDCole merged 21 commits into
mainfrom
feature/conductor_agents
Sep 24, 2026
Merged

NicholasDCole merged 21 commits into
mainfrom
feature/conductor_agents

Conversation

@NicholasDCole

@NicholasDCole NicholasDCole commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Add Conductor-Agents parity to Ruby SDK

1.

health_advisor failure is as expected --is a guardrail
image

image

NicholasDCole and others added 19 commits September 8, 2026 15:20
Adds the Ruby agents parity one-pager (mirror of the Confluence plan), the
tools/streaming/teams/secrets/testing sub-specs, and the implementation plan
that reconciles them against the Python SDK and the server-side agent API.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…te-v2

- Configuration caches the auth token per instance; class-level accessors stay
  as a deprecated shim that warns once
- Task#runtime_metadata (wire-only secret values) and TaskDef#runtime_metadata
  (declared secret names) plus TaskDef#enforce_schema
- TaskResourceApi#update_task_v2; TaskRunner prefers POST /tasks/update-v2 and
  falls back to POST /tasks once on 404/405 (Python parity); Worker gains the
  lease_extend_enabled option
- AgentResourceApi + AgentClient for /api/agent/* (start, deploy, compile,
  status, execution, executions, respond/approve/reject, stop, signal, pause,
  resume, cancel, list/get/delete) and OrkesClients#get_agent_client
- AgentApiError / AgentNotFoundError carrying the server's {error, status} body
- Dev deps: drop unused vcr, add json_schemer for agent contract tests

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- ToolDef/ToolType with Python defaults and factories (http, api, mcp, human, agent,
  media, RAG, wait_for_message)
- Tools DSL: `tool def` builds a ToolDef from keyword defaults via the method AST
  (city: String required, units: 'metric' optional, [String] arrays, %w[] enums),
  scans literal secret()/secrets_env() names as credentials, describe /
  requires_approval / tool_credentials, per-module lookup (Weather[:current]),
  global registry for Agent#add_tool(:name), RubyLLM::Tool adapter, AST-less fallback
- Guardrail / RegexGuardrail / LlmGuardrail, Termination::* with & and |,
  Handoff::*, CallbackHandler, ConversationMemory, PromptTemplate
- Agent with team/guardrail/termination/approval sugar (add_tool, add_agent,
  hands_off_to, redact, stop_when, stop_after, on_approval, >>)
- ConfigSerializer: same wire shape as Python (camelCase, nil-compacted, agent
  credentials top-level, tool credentials under config), team parents inherit the
  first member's model, member hands_off_to hoists into a swarm team
- Contract tests: vendored agent-schema.json + 19 golden configs from python-sdk;
  every golden serializes identically and validates; examples/agents/golden_agents.rb
  and dump_agent_configs.rb regenerate them

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… workers

- AgentRuntime: call_sync / call_async (POST /agent/start, register the workers the
  server lists in requiredWorkers, stream on a background thread), deploy, compile,
  serve, shutdown; Conductor::Agents.runtime default instance and .configure
- SseClient over Net::HTTP: incremental parser (comments, ids, multi-line data),
  reconnect with Last-Event-ID, heartbeat-only detection, SseUnavailableError ->
  StatusPoller fallback over GET /agent/{id}/status
- Execution (done?, waiting?, result with timeout, partial_text, finish_reason,
  tool_calls, token_usage summed over sub-executions, pause/resume/cancel/stop/signal,
  Execution.find) and ApprovalRequest (batch tool calls, argument accessors, approve /
  reject / send_message posting the server's respond bodies); on_approval wiring with
  execution.pending when no handler is registered
- Dispatch: strips server-injected keys (method, _agent_state, _agent_tool_name,
  _allowed_commands), validates required args, coerces by JSON schema, wraps scalar
  results, terminal failures for missing args/credentials/unserializable output
- Secrets.secret / secrets_env read Task#runtime_metadata via TaskContext, fall back to
  ENV, never write ENV
- ToolRegistry builds Worker.define-style workers with Python's TaskDef defaults
  (retry 2, LINEAR_BACKOFF, timeout 0, response timeout 10, RETRY, runtimeMetadata)
  and SystemWorkers for <agent>_termination, custom guardrails, callbacks and
  on_condition handoffs; unknown required workers are logged
- AgentConfig.from_env for CONDUCTOR_AGENT_* settings

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- spec/agents/agents_helper.rb: `mocks: 'agent/tool_happy_path'` points the SDK at a
  WireMock replay of conductor-mocks (CONDUCTOR_AGENTS_REPLAY_URL, or a container
  started from CONDUCTOR_MOCKS_DIR), resets scenarios per example and fails when the
  SDK sent a request the recorded server never saw
- spec/agents/replay/tool_happy_path_spec.rb: the one-pager weather agent end to end:
  start, TaskDef PUT, SSE stream, poll, in-process tool run, update-v2, done, token usage
- CI: agents-replay job checks out conductor-oss/conductor-mocks, starts
  wiremock/wiremock:3x and runs spec/agents

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…angelog

- examples/agents: weather.rb (tools), support_approval.rb (streaming + approval),
  bug_desk.rb (team + secret), matching the one-pager
- docs/agents: README plus concepts for tools, calling/approval, teams, secrets,
  runtime and testing
- README agents section and example table; AGENTS.md architecture, directory, test
  layout, docker test recipe and 'changing the agents wire format' checklist;
  DESIGN.md agents layer
- CHANGELOG: agents feature, runtimeMetadata, update-v2, instance token cache, vcr removal
- Plan: implementation status table and decisions 2.18-2.20 (update-v2, swarm hoisting
  for hands_off_to, run domain for every worker); notes in AGENT_TEAMS.md and the one-pager

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@NicholasDCole
NicholasDCole requested a review from v1r3n September 23, 2026 23:52
@NicholasDCole
NicholasDCole force-pushed the feature/conductor_agents branch from ae9642c to ccead57 Compare September 24, 2026 18:23
@NicholasDCole
NicholasDCole merged commit 995997a into main Sep 24, 2026
10 checks passed
@NicholasDCole
NicholasDCole deleted the feature/conductor_agents branch September 24, 2026 19:13
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.

4 participants