liteFlow/liteflow-react-agent/liteflow-react-agent-core
everywhere.z dd08efc5b3 feat(agent): AgentEventBridge 恢复流式(streamEvents→FlowEvent)+ 流式路径 ChatUsage 线程安全
Task 6.1:恢复 process() 流式路径。当 slot 有 FlowEvent 监听者(ExecuteOption.eventListener)
时走 ReActAgent.streamEvents → AgentEventBridge 映射成 FlowEvent 发布;否则仍 call()。

- 新增 AgentEventBridge.streamAndPublish:TEXT_BLOCK_DELTA→agent.reasoning、
  TOOL_RESULT_*→agent.tool_result、HINT_BLOCK→agent.summary、AGENT_RESULT→agent.result(last=true),
  HITL(RequireUserConfirm/RequireExternalExecution)可选透传。
- ChatUsage 线程安全(findings R-stream):真实 vendor 模型下 onModelCall 在 boundedElastic
  调度线程执行,ThreadLocal 读不到 bind 的累加器。改用 reactor Context 双源(Context 优先、
  ThreadLocal 回退),process() 经 bindToContext 注入;保留 void bind() 二进制兼容,
  新增 bindAndReturn()。流式/非流式两路径都注入 Context。
- StreamingBridgeTest:mock 模型流式回放,断言 reasoning 增量 + 末尾 agent.result(last=true) +
  流式下 getChatUsage() 正确(验证 Context 传播)。
- findings 追加 R-stream 节(streamEvents/call 线程模型 + Context 方案)。

Tests run: 21, Failures: 0, Errors: 0(StreamingBridge/ChatUsageMiddleware/ProcessIntegration/
ShellPermissionBehavior/SkillLoading/SkillTracking)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-20 11:35:33 +08:00
..
src/main/java/com/yomahub/liteflow/agent feat(agent): AgentEventBridge 恢复流式(streamEvents→FlowEvent)+ 流式路径 ChatUsage 线程安全 2026-06-20 11:35:33 +08:00
pom.xml refactor(agent): v2 绿编译基底(删 v2-broken 源码 + stub process)+ API 探针发现笔记 2026-06-19 22:35:31 +08:00