Skip to content

Route pod-based coding agents to BridgedAgentWorkflow - #204

Merged
imaustink merged 1 commit into
mainfrom
fix/agent-bridged-workflow-annotation
Aug 7, 2026
Merged

Route pod-based coding agents to BridgedAgentWorkflow#204
imaustink merged 1 commit into
mainfrom
fix/agent-bridged-workflow-annotation

Conversation

@imaustink

@imaustink imaustink commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

claude-code-swe-agent and opencode-swe-agent never set the durable-agents.dev/bridged: "true" annotation that the Temporal engine's agentWorkflowNameFor (engines/temporal/internal/temporal/workflows/agent_workflow.go) uses to route an Agent to BridgedAgentWorkflow (drives an unmodified upstream pod/CLI agent over the real NATS protocol) instead of falling through to the declarative AgentWorkflow (an LLM planner that only ever calls Tools named in the agent's own toolRefs).

Without the annotation, both agents fell through to the declarative loop. The planner got the agent's real agentPrompt — which tells the model to invoke git/gh as plain CLI commands — but an empty tools list (neither agent declares toolRefs, since their real tools are the CLI's own bash/file built-ins). So the model tried to call "gh" (and variants like gh_repo_clone, call_tool) as a declarative Tool and was refused every time with "tool not available to this agent" — matching a production failure observed on a real "open a PR" request, where the real Claude Code CLI pod never even started; a generic in-Temporal planner substituted for it and was always going to fail, having no real tools at all.

stub-agent (apps/stub-agent, the e2e hermetic stand-in for claude-code-swe-agent) had the identical gap — fixed the same way so it stays a faithful stand-in once a cluster actually routes turns through the Temporal engine. (opencode-swe-agent is fixed in the chart too, but has no live CR in this e2e cluster since it's disabled there — covered instead by the new Go test.)

Fix

Added metadata.annotations: {durable-agents.dev/bridged: "true"} to:

  • charts/community-components/templates/agent-claude-code-swe.yaml
  • charts/community-components/templates/agent-opencode-swe.yaml
  • charts/community-components/templates/agent-stub.yaml

Test coverage (previously none existed for this routing path)

  • engines/temporal/internal/temporal/workflows/agent_workflow_routing_test.go — hermetic Go test pinning agentWorkflowNameFor's routing contract (bridged/step-tool/neither) and decoding Agent CRs shaped like the two real pod agents to assert they resolve to BridgedAgentWorkflow.
  • e2e/specs/bridged-agent-routing.e2e.ts — asserts the live, cluster-deployed claude-code-swe-agent and stub-agent CRs actually carry the annotation, so a future chart edit that drops it again is caught against a real minikube deploy, not just chart-rendering logic.

Test plan

  • go test ./... in engines/temporal — all packages pass, including the new routing test
  • gofmt -l . / go vet ./... / go build ./... clean in engines/temporal
  • helm template verified both fixed chart templates render the annotation correctly
  • Upgraded the community-components release on minikube and confirmed the live Agent CRs (claude-code-swe-agent, stub-agent) carry durable-agents.dev/bridged: "true"
  • Full e2e suite (npm run e2e -w e2e) against minikube: 7 spec files passed, 57 tests passed, 1 skipped — no regressions

🤖 Generated with Claude Code

https://claude.ai/code/session_01HctRMtdZixptEZeMebhADq

claude-code-swe-agent and opencode-swe-agent never set the
durable-agents.dev/bridged annotation the Temporal engine's
agentWorkflowNameFor uses to pick BridgedAgentWorkflow over the
declarative planner loop. Without it, both fell through to the
declarative AgentWorkflow, which got the agent's real prompt (telling
it to use git/gh) but an empty tools list -- so the planner tried to
call "gh" as a declarative Tool and was refused with "tool not
available to this agent", exactly matching a captured production
failure. stub-agent (the e2e stand-in for claude-code-swe-agent) had
the same gap and is fixed the same way, to stay a faithful stand-in
once a cluster routes turns through the Temporal engine.

Adds a hermetic Go regression test pinning agentWorkflowNameFor's
routing contract, plus an e2e spec asserting the live deployed Agent
CRs carry the annotation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HctRMtdZixptEZeMebhADq
@imaustink
imaustink merged commit 9aadc55 into main Aug 7, 2026
7 checks passed
@imaustink
imaustink deleted the fix/agent-bridged-workflow-annotation branch August 7, 2026 22:58
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