32 Commits

Author SHA1 Message Date
everywhere.z
5b749ffd80 test(agent): 按 feature/platform 维度重组 react-agent 测试模块
将原先扁平的 connectivity/feature/unit/cmp 测试布局重构为按功能
(feature/*)和按供应商平台(platform/*)划分的独立目录,每个目录
自带隔离的测试资源(application.properties + flow.el.xml),并相应
更新 BaseAgentLiveTest、LiveTestEnv、LiveTestSupport 等支撑类与使用指南文档。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 23:55:42 +08:00
everywhere.z
115ffd652c refactor(agent): replace SkillToolManifest with SkillToolResolver and relocate test
- Switch SkillBoxFactory to SkillToolResolver, which resolves tool classes from
  the framework container (enabling DI) and falls back to no-arg reflection,
  resolving tools per AgentSkill instead of by name.
- Remove the obsolete SkillToolManifest.
- Move ReActAgentComponentTest from liteflow-react-agent-core to
  liteflow-testcase-el per the test-placement convention.
- Drop the temporary surefire skipTests=false override in react-agent-core.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:29:49 +08:00
everywhere.z
ec5562c45f build(agent): allow surefire tests to run in react-agent test module
The root POM hardcodes skipTests=true in pluginManagement. Override
at module level with ${maven.test.skip} so tests actually execute
when invoked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:40:15 +08:00
everywhere.z
29e387426a test(agent): cover skill tool container fallback and defensive paths
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:40:09 +08:00
everywhere.z
e8cb271d5a feat(agent): resolve skill tools from container to enable DI
SkillToolResolver 优先按类型从 ContextAware 容器取已注册的工具 bean,
使其依赖注入生效;容器未就绪/未注册时降级反射实例化。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:30:57 +08:00
everywhere.z
8ea01d2e88 feat: add default system prompt, shell safety checks, and deterministic test models
- Add DEFAULT_SYSTEM_PROMPT and effectiveSystemPrompt() to ReActAgentComponent
- Block unsupported shell syntax (pipes, redirections, chaining) in ManagedShellCommandTool
- Fix process I/O to prevent hangs when command waits for stdin
- Fix missing sessionId in ReActLoggingHook result log line
- Introduce FakeEchoModel for deterministic local testing
- Add unit tests for ReActAgentComponent, ReActLoggingHook, and shell syntax rejection
- Remove LiveTestSupport credential skip calls from feature tests

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 23:23:45 +08:00
everywhere.z
65cbb1ecd5 feat(agent): wire conversation workspace into skill code execution
Pass the ReAct agent context workspace directory through SkillBoxFactory
so SkillBox's code execution runs against the conversation workspace
instead of the process default.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:00:37 +08:00
everywhere.z
f70d4aa1c1 build(test): drop redundant surefire override for react agent tests
Remove the maven-surefire-plugin skipTests=false override in
liteflow-testcase-el-react-agent, leaving the test module to inherit
the parent configuration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 19:13:44 +08:00
everywhere.z
828a2d9099 test(agent): reorganize react agent test coverage 2026-05-13 23:31:07 +08:00
everywhere.z
2011d6898b test(agent): cover react-agent feature scenarios end-to-end
Add focused feature suites under react-agent test resources for
conversation/agentKey isolation, compatible-custom platform handshake,
managed shell mode, workspace file tools, skills loading, and a live
platform connectivity probe — each with its own EL chain, properties,
and prepare/record components.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:24:21 +08:00
everywhere.z
65a6213b72 feat(core): add generic flow event channel for streaming output
Introduce FlowEvent/FlowEventListener/FlowEventPublisher on the Slot so
callers can subscribe via ExecuteOption.eventListener and receive
incremental events while a chain is running. ReActAgentComponent wires
agentscope reasoning/tool_result/summary/result events into this channel
when a listener is registered, keeping the non-listener path as a plain
blocking call.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:24:10 +08:00
everywhere.z
d8fd7f6015 feat(agent): integrate skills with react agent component 2026-05-10 22:20:14 +08:00
everywhere.z
a3bf935c5c feat(agent): track loaded skills 2026-05-10 21:53:06 +08:00
everywhere.z
db4a099361 feat(agent): load skills into skill box 2026-05-10 21:34:13 +08:00
everywhere.z
18007cf855 test(agent): cover skill box factory behavior 2026-05-10 16:41:28 +08:00
everywhere.z
3175af400d feat(agent): refactor session management to dual-key (conversationId + agentKey)
AgentSessionManager 从单一 sessionId 改为 (conversationId, agentKey) 双 key 架构:
同一 conversationId 下多个 agent 共享 workspace 目录但各自拥有独立的 AgentSession
和对话记忆。删除 NanoIdSessionIdGenerator(conversationId 生成职责上移到 core 层
的 ConversationIdGenerator)。新增 ReActAgentConversationContinuityTest 和
ReActAgentMultiAgentChainTest 覆盖对话连续性和多 agent 协作场景。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:01:39 +08:00
everywhere.z
36d945fca2 test(react-agent): cover ctx() lifecycle invariants
- 验证 agent 缓存复用时 model 内 ctx() 取到当次 ctx 而非陈旧引用
- 验证不变量字段(conversationId/agentKey/workspaceDir)跨次一致

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:29:40 +08:00
everywhere.z
67a9b9bed7 refactor(react-agent): make all hooks parameterless via slot-bound ctx
- ReActAgentComponent 所有 hook 改为无参签名,新增 protected final ctx() 访问器
- ctx 通过 Slot.setAttachment 按 _react_agent_ctx_<nodeId> 挂载,process() finally 解绑
- 按 nodeId 隔离 attachment key,支持 WHEN 并发场景多个 agent 节点共享 slot
- 7 个测试 cmp 子类全部迁移到新签名
- StubModel 改为持有组件引用,运行时动态调 comp.ctx() 取当次 ctx

破坏性变更:所有 ReActAgentComponent 子类必须更新签名。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:22:43 +08:00
everywhere.z
7fe12ed624 chore(agent): 补全 agent 配置 javadoc 与 spring 配置元数据,精简测试模块 pom
- 为 agent 配置类(AgentConfig/SessionConfig/ShellConfig/MemoryStorageConfig 等)补充中文 javadoc
- 在 spring-boot-starter / spring-boot4-starter 的 additional-spring-configuration-metadata.json 中补全 liteflow.agent.* 配置项,提供 IDE 配置提示
- 合并 testcase-el 中 react-agent 与 springboot4 的 profile,移除子模块冗余的 maven-compiler/surefire 配置
- 移除已不再使用的 AgentConfig / LiteflowConfigAgentField / Boot4AutoConfiguration 测试文件

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 23:25:07 +08:00
everywhere.z
f65d4264b9 docs(react-agent): 补充下游节点获取 Agent 结果的说明,扩展 react-agent 测试模块多平台用例
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 12:32:37 +08:00
everywhere.z
47095ddd40 test(react-agent): consolidate test suite to a Gemini integration test
Remove the per-platform model/factory/entry tests and the unit-style
tool/session/component tests; keep a single Spring Boot integration
test that exercises the full ReAct chain against Gemini.

The pruned tests were tightly coupled to the older ModelSpec/Builder
APIs and largely duplicated coverage now provided by the integration
flow plus the new logging hook visibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 11:49:39 +08:00
everywhere.z
61824d6956 feat(react-agent): add session factory infrastructure, memory storage config, and integration tests
- Add MemoryStorageConfig/MemoryStorageMode and per-backend configs (Redis, MySQL, workspace file)
- Add AgentSessionFactoryRegistry with NONE, JVM, WORKSPACE_FILE, REDIS, MYSQL implementations
- Add integration test suite with EL-orchestrated Spring Boot tests
- Remove per-module READMEs in favor of unified guide
- Update POMs, CLAUDE.md, AGENTS.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 19:12:29 +08:00
everywhere.z
c612dfaf72 test(react-agent): migrate test cmps to ModelSpec API
Replaces buildModel(ctx) overrides with model(ctx) returning
DeepSeek/OpenAI/Anthropic/Gemini/DashScope spec instances.
Also updates TestAgent inner classes in ReActAgentComponentTest
and MemoryStoragePersistenceTest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:30:21 +08:00
everywhere.z
055e7399e1 feat(react-agent-dashscope): add DashScope entry and DashScopeSpec
DashScope.of(modelName) returns DashScopeSpec with a thinking
sub-builder using DashScope's native budget term.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:22:39 +08:00
everywhere.z
64d5404b2c feat(react-agent-gemini): add Gemini entry and GeminiSpec
Gemini.of(modelName) returns GeminiSpec exposing a thinking sub-builder
that supports both Gemini 2.5's level() and the legacy budget() form.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:22:33 +08:00
everywhere.z
994cbd2a25 feat(react-agent-anthropic): add Anthropic entry and AnthropicSpec
Anthropic.of(modelName) and AnthropicCompatible.custom(configKey,
modelName) return AnthropicSpec, with a thinking sub-builder using
Anthropic's native budget/enabled terms.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:22:27 +08:00
everywhere.z
679dc33ca2 feat(react-agent-openai): add OpenAI-compatible vendor entries
DeepSeek/Kimi/GLM/Minimax static entries with default baseUrls,
plus OpenAICompatible.custom() fallback for arbitrary vendors.
All read credentials from liteflow.agent.openai-compatible.<key>.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:15:36 +08:00
everywhere.z
5cc43acff2 feat(react-agent-openai): add OpenAI entry and OpenAISpec
OpenAI.of(modelName) returns an OpenAISpec exposing reasoningEffort,
frequencyPenalty, and presencePenalty in addition to the common
ModelSpec setters; resolve() reads liteflow.agent.openai credential.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:11:54 +08:00
everywhere.z
b40ec52632 feat(react-agent-core): add CredentialResolver helper
Centralizes credential lookup with consistent AgentConfigException
messages that point at the relevant liteflow.agent.* config path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 18:06:46 +08:00
everywhere.z
4abb4d1eb4 fix(react-agent-core): widen ModelSpec.resolve to public
resolve() is the framework SPI: ReActAgentComponent (in a different
package) needs to call spec.resolve(cfg), which protected access
does not permit. The test's TestSpec override is widened in lockstep
since Java forbids narrowing visibility on override.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 17:54:26 +08:00
everywhere.z
c417620f2c feat(react-agent-core): introduce ModelSpec base class
Vendor-neutral model descriptor with common fluent setters
(temperature/topP/topK/maxTokens/seed/stream/cacheControl) and an
abstract resolve(AgentConfig) SPI that provider modules implement.
2026-04-29 17:43:38 +08:00
everywhere.z
b63bc1a7f4 docs(react-agent): add design spec for ModelSpec API redesign
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 17:28:23 +08:00