fix: ZER-669 P1 遗留修复:详情冷启动补历史 / 来源链接语义 / 状态展示映射 - #35
Closed
ZeroPointSix wants to merge 8 commits into
Closed
Conversation
…ntral status map (ZER-669)
7 tasks
This was referenced Aug 12, 2026
10 tasks
Owner
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
关联 Issue
Linear: ZER-669 [W2] P1 遗留修复:详情冷启动补历史 / 来源链接语义 / 状态展示映射(父任务 ZER-404,关联 ZER-414)
改动内容
1. 详情冷启动补历史(SSE replay)
crates/openab-gateway/src/session_admin.rs:SSE 端点/api/v1/sessions/events在请求未携带Last-Event-ID时(冷启动/刷新/深链直达)改为subscribe_after(Some(0)),从头重放事件总线中保留的历史;重构replay_events_sse使回放与续传共用一条路径。crates/openab-gateway/tests/admin_api_integration.rs:新增sse_cold_start_without_last_event_id_replays_retained_history集成测试。web/src/hooks/useSessionStream.ts:改用内存游标去重(不再用 sessionStorage 恢复游标),保证详情页始终只有一条 SSE 连接且冷启动可收全量历史。web/src/lib/session.ts:新增visibleTimelineItems,过滤初始种子占位项,避免与回放历史重复展示。2. 来源链接语义(permalink)
crates/openab-core/src/session_snapshot.rs:SessionSource新增permalink: Option<String>(#[serde(default, skip_serializing_if)])+set_source_permalink。crates/openab-core/src/acp/profile_pool.rs:新增SessionPool::record_session_source_permalink(幂等,值未变不写盘)。crates/openab-core/src/slack.rs:slack_ts_permalink_fragment/slack_thread_permalink构造 Slack 线程深链(app.slack.com/client/{team}/{channel}/p{ts}?thread_ts=…),在handle_message分发前回填;含单测。crates/openab-core/src/discord.rs:discord_channel_permalink(guild 频道/channels/{guild}/{channel},DM 用/@me/),在Handler::message中回填;含单测。web/src/pages/SessionDetailPage.tsx:permalink存在时主按钮变为「回到 Slack/Discord」,另有「复制会话链接」;「打开来源」不再指向 Plus Web 自身。web/src/types.ts:SessionSource.permalink?: string。3. 状态展示映射集中化
web/src/lib/sessionStatus.tsx:SESSION_STATUS_DISPLAY/sessionStatusDisplay/SESSION_STATUS_FILTER_OPTIONS/SESSION_STATUS_VALUE_ENUM(后端starting/idle/running/suspended/error/exited→ 启动中/空闲/运行中/等待/失败/完成),前端仅此一处维护。StatusTag.tsx/SessionTable.tsx/OverviewPage.tsx统一改用该映射;lib/format.ts移除旧statusLabels,新增sourcePlatformLabel。测试
在 VPS 测试机(kuoya-sgp-001, 4C8G, cargo 1.97.1 / node 20 / pnpm 10.14)实测:
cargo test -p openab-core --lib:745 passed, 0 failed(含本次新增 permalink 单测)pnpm install --frozen-lockfile && pnpm lint && pnpm test:27 passed (6 files),tsc 类型检查通过cargo test -p openab-gateway --test admin_api_integration:VPS 上链接器两次 Bus error(rust-lld 环境问题,非代码问题),请 CI 复跑确认验收对照
SessionSource.permalink已落库,Slack/Discord 适配器回填并可反向跳回线程