Repository navigation
Agent extension points: LlmClient/ConversationMemory SPI, connector-backed agent tools, event triggers - #5408
Merged
qqeasonchen merged 1 commit intoSep 21, 2026
Conversation
qqeasonchen
force-pushed
the
feat/agent-connector-tools
branch
from
September 21, 2026 07:57
779f117 to
92403fe
Compare
Contributor
Author
|
Rebased onto the latest develop ( Conflict resolution notes:
|
…acked agent tools and event triggers - Extract the LlmClient SPI (token streaming + function-calling chat); OpenAiLlmClient becomes its default implementation - Extract the ConversationMemory SPI; ConversationStore (in-memory sliding window) implements it - Add the AgentTool SPI + ToolRegistry and a bounded function-calling loop in StreamingAgent (streaming unchanged when no tools are registered) - Add ConnectorToolAdapter: any sink connector becomes a write tool and any source connector a read tool, turning the 23 shipped connector plugins into the agent tool library - Add an event-driven trigger path: agent.subscribe.topics -> prompt -> answer (with tools) -> published to agent.trigger.output.topic for sink delivery - Fix runtime-port drift in agent/connector/examples defaults: 8080 -> 10105 - Docs: docs/feature/agent-tools.md + index entry
qqeasonchen
force-pushed
the
feat/agent-connector-tools
branch
from
September 21, 2026 08:15
92403fe to
69f5cc5
Compare
qqeasonchen
added a commit
that referenced
this pull request
Sep 21, 2026
…-runtime, connector-api under connector-plugin (follow-up to #5408) (#5409) * AgentTool SPI: plugin-jar deployment for custom agent tools - Annotate AgentTool with @EventMeshSPI (new AGENT_TOOL extension type); custom tools now register via META-INF/eventmesh/<AgentTool-FQCN> service files exactly like storage/connector plugins - ToolRegistry.registerSpi(name) resolves implementations through EventMeshExtensionFactory (singleton semantics, classpath + plugin-jar loaders) - AgentApplication: -Dagent.tools.spi=<name,...> enables SPI tools alongside connector-backed tools - start-agent.sh: jars under plugin/agent/ join the agent classpath (same convention as plugin/connector/ in the connector runtime) - Tests: AgentToolSpiTest drives the real factory + a test service file (echo-test) through registerSpi; unknown-name rejection path covered - Docs: agent-tools.md SPI section + config-table entry; agent.properties key doc * AgentTool SPI follow-up: module restructure — connector-api under connector-plugin, agent -> agent-runtime, new agent-plugin tree - Move eventmesh-connector-api -> eventmesh-connector-plugin/eventmesh-connector-api (SPI jar lives with its plugin family, like storage/protocol) - Rename eventmesh-agent -> eventmesh-agent-runtime (it is a process runtime, matching eventmesh-connector-runtime) - New eventmesh-agent-plugin/ tree: umbrella + eventmesh-agent-plugin-http-fetch (first in-tree AgentTool plugin: fetch a URL, return truncated body; pluginType=agentTool, pluginName=http-fetch, META-INF service file included) - dist-agent now installs pluginType==agentTool modules into dist-agent/plugin/agent/<name>/ (same convention as dist-connector/plugin/connector) - References updated: settings.gradle, root build.gradle (findProject paths), all 23 connector plugin build files, architecture-guard, runtime test dep, docs * Fix restructure: point connector-runtime at the moved connector-api module path * Fix restructure: point all 23 connector plugins at the moved connector-api path (double-quote form) * Fix restructure: update connector-api-split.md paths to the moved module * Fix http-fetch plugin: drop unused @Slf4j/lombok, slim deps (spi types resolve via agent-runtime)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5407
Summary of changes
Agent extension points (connector-first):
LlmClientSPI (agent.llm): tokenstream()+ function-callingchat()withToolSpec/ToolCall/Completionrecords;OpenAiLlmClientimplements it and gains non-streamingchat()(OpenAI tools wire format, mock-tested)ConversationMemorySPI:ConversationStore(in-memory sliding window) now implements the interface; persistent backends can be constructor-injectedAgentToolSPI +ToolRegistry: name+schema+invoke tools;StreamingAgentconstructor takes an optional registry and, when non-empty, runs a bounded function-calling loop (≤5 iterations, tool results fed back as messages). No tools registered → behavior unchanged token-by-token streamingConnectorToolAdapter: anySinkConnector→ write tool (args object wrapped as one CloudEvent →put()+commit()); anySourceConnector→ read tool (poll()one batch → JSON array). Class-based (system-property wired inAgentApplication) and instance-based overloadsagent.subscribe.topics/agent.trigger.output.topic— each consumed CloudEvent becomes a prompt (trigger:<eventId>conversation), answered with tools, answer published to the output topic for sink delivery. Uses a dedicatedCloudEventsClientso the agent lite-channel poller is untouchedAgentApplication,ConnectorApplication,start-connector.sh,connector.properties,agent.properties,StreamingCallDemo— default runtime URL8080→10105(matchesEventMeshApplication's default)docs/feature/agent-tools.md(extension surface table, connector-as-tools, triggers, embedder API, config reference) +docs/index.mdentryAgent boot wiring (
AgentApplication):agent.tools.sink.<name>=<fqcn>/agent.tools.source.<name>=<fqcn>+agent.tools.props.<name>.*build the tool registry; connector jars just need to be on the agent classpath.Tests
ToolRegistryTest— registry lookup, spec rendering, unknown-tool error (3 tests)ConnectorToolAdapterTest— sink tool delivers args as CloudEvent (asserts serialized data), source tool returns batch as JSON array + empty batch (3 tests)OpenAiLlmClientChatTest— tool-call parsing, plain-text completion, tools advertised in request body (3 tests, in-process mock)ConversationStoreTestunchanged and still passing (interface extraction is source-compatible:ConversationStorestill concrete)Notes for reviewers
ToolSpec/ToolCallare flagged [WARN] by local checkstyle 9.0 (MethodNameon record decls); records are used across the codebase (e.g.AgentControlClient.RegisterResult) so CI's checker accepts themeventmesh-agentnow depends oneventmesh-connector-api(compile) +io.cloudevents:cloudevents-core— the architecture guard only constrains plugin→runtime, this direction is unconstrained