You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
变更概述
本 PR 修复浏览器/raw-media 会话的启动与停止流程:把 participant token 生成和显式 agent dispatch 解耦,增加可取消的 room session 状态,并收紧 dispatch 重试时的 agent participant 匹配逻辑。目标分支是
lex-main。主要改动
1. Session lifecycle API
sessionId协调。/api/session/dispatch,支持重试、取消、dispatch 清理,以及 stop 抢先完成时的 LiveKit room 清理。/api/session/stop和共享 stop helper,让浏览器会话可以先释放本地 UI 状态,再等待较慢的远端清理。2. 浏览器与 mixed input 客户端流程
3. Dispatch 安全性与项目配置
isExpectedAgentParticipant:只有 LiveKit agent 属性匹配配置的agentName时才认为目标 agent 已加入,避免把无关的agent-*identity 误判为目标 agent。.env.example保持 documentation-only。components.json的 shadcn CSS 入口到styles/globals.css,并加入项目配置测试防止路径漂移。影响说明
lk.agent.name/lk.agent_name属性的 agent dispatch 重试更久,但能避免无关 agent participant 造成假成功。.env.example只作为文档样例,不再被测试要求承载 integrated runtime 配置。验证
pnpm test✅ passed: 37 tests passed
pnpm exec tsc --noEmit✅ passed: TypeScript completed successfully
pnpm lint✅ passed: ESLint completed successfully
pnpm build✅ passed: Next.js production build completed successfully
pnpm exec prettier --check .✅ passed: Prettier reported all matched files use the expected style
pnpm dlx shadcn@latest info --json✅ passed: reports
tailwindCss: "styles/globals.css"