Skip to content

v0.4.0

Choose a tag to compare

@Icatme Icatme released this 11 Aug 15:58
· 51 commits to main since this release

主要更新

  • 可靠入站投递:持久化 replay 去重、原子 cursor/context/replay 状态、异常消息 fail-closed。
  • 上下文感知的 Handler,并通过 Ack / Retry / Drop 明确控制消费语义。
  • 同会话串行、跨会话并发的有界 dispatcher,以及有序 cursor 提交。
  • Agent 消息字段与工具调用开始/结果项(类型 11/12)。
  • 稳定的出站 client_id / run_id、单请求发送结果与 BeforeSend / AfterSend 生命周期钩子。
  • 可由 errors.As 识别的结构化 APIError。
  • -14 后显式、fail-closed 的重新认证;持久化 marker 防止进程重启后复活失效凭据或 context。

破坏性变更

  • Bot.OnMessage(func(*IncomingMessage)) 已替换为 Bot.Handle(MessageHandler);Handler 必须接收 context.Context 并返回 MessageResult。
  • LifecycleHooks.BeforeSend 的 payload 从 *SendContent 改为真实 wire envelope *SendRequest,并新增 AfterSend。
  • 会话过期不再自动暂停一小时后重试旧 token。调用方应处理 ErrReauthRequired,并在合适的交互时机显式调用 Reauthenticate(ctx)。

验证

  • go build ./...
  • go test ./...
  • go test -race ./...
  • go vet ./...
  • go mod verify
  • GitHub Actions:Ubuntu、Windows、macOS 三个平台任务通过

完整变更

#1 · #2 · #3 · #4 · #5 · #6 · #7 · CI #8

比较 v0.3.0...v0.4.0