Skip to content

Beta agent#38

Merged
thirdgerb merged 249 commits intomainfrom
beta-agent
May 5, 2026
Merged

Beta agent#38
thirdgerb merged 249 commits intomainfrom
beta-agent

Conversation

@thirdgerb
Copy link
Copy Markdown
Contributor

No description provided.

Summary:

1. refact channel broker and make it capable of handling lifecycle
   blocking task alone
2. refact channel, remove the context methods
3. refact channel runtime it does not manager lifecycle tasks.
4. refact duplex channel proxy / provider with new broker and runtime.

Why:

- Channel 和 Channel Broker 相互持有一直是大问题, 这次改成 Broker 持有
  Channel.
- Broker 独立管理 idle/pause/blocking task 的生命周期,
  这是为了保证在双工通讯下, 任何一个分形单位都不再出现时序冲突.
  严格保证单一性.
- 将分散在 channel, broker, command task 三处的 contextvar 管理合并到了
  channel ctx
- 由于 Broker 可以独立管理 lifecycle blocking task, 所以 channel
  provider 和 channel runtime 只需要关心阻塞逻辑,
  不再自行管理雷同的生命周期清理
- ChannelRuntime 实现了父子轨道阻塞, 还需要更多单元测试.
  现在子轨道未清空时也会阻塞父轨道. 所以要尽快完成 speech 轨道的改造.
- ChannelRuntime 现在改造成了分形递归, 一个原因是 ChannelRuntime 的
  clear 和 refresh 逻辑如果不放在 channel provider 侧复用,
  则两边的生命周期管理雷同而混乱. 这一次直接让 Channel Provider 管理
  Channel Runtime了.
- 完善了 CommandErrorCode, 建立了多种类型的分级. 方便下一步 interpreter
  对不同分级的 command 异常进行不同原理的管理.
- 修复了 Duplex Channel 和单测, 基线单元测试都通过.
  也补充了许多单元测试. 还需要补充更多. 尤其是 ChannelRuntime
  分形处理并行轨道的阻塞逻辑.
- CommandTask 实现了 __await__, 这样各种阻塞逻辑可以直接用它,
  而不用再去搞 wait 了.
- 实现了 AbsChannelBroker 用来解决各种 Broker 的一致性逻辑问题.

TODO:
1. Shell 重构, 使用新的 ChannelRuntime.
2. 实现正确的 States 和 Topics, 解决好双工通讯问题.
3. Speech 拆分为一个轨道. 同时增加阻塞原语, 确保运行正常.
Summary:
1. ctml now support  to define a command call with cmd idx
2. allow ctml add attr prefix parser such as
Summary:

大型重构, 合并了 ChannelBroker 抽象和 ChannelRuntime 抽象. 并简化了 Duplex 的技术实现.

Why:

长期依赖因为 Channel Broker, Duplex, ChannelRuntime 三个抽象相分离, 导致大量的重复性实现, 代码的逻辑也极其复杂.
这次为了解决历史遗留问题, 一次性将三者做了简化合并, 做范式上的更新
1. SpeechChannel Wrapper
2. delta stream send through proxy to provider
3. speech, tts update
4. ctml element support literal eval
@thirdgerb thirdgerb merged commit 329e186 into main May 5, 2026
@thirdgerb thirdgerb deleted the beta-agent branch May 5, 2026 18:01
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.

3 participants