docs(integration): record session model hotfix promotion

This commit is contained in:
2026-08-20 23:31:40 +08:00
parent c0163bc507
commit 460268586b
7 changed files with 70 additions and 11 deletions

View File

@@ -4,6 +4,14 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- OpenCode Session model and partner hot-add source commit `c0163bc` from feature task
`20260820-session-model-agent-hotfix-6e4c9a2f` is integrated on local `main` by task
`20260820-integrate-session-model-hotfix-7b3e91c4`. Page selection and `/models` /
`/model` now switch the active OpenCode Session model without provider persistence or
runtime restart, while a partner model remains only the new-Session default. Agent
readiness is tracked per id: a new unique id may be accepted after live discovery in
an owned fresh generation, while same-id edits, delete/recreate and attached/unknown
generations remain pending.
- Learning archive size-validation source commit `8509084` from feature task
`20260820-remove-download-size-check-4f8a2c1d` is integrated by task
`20260820-integrate-download-size-6e3a91c2` through merge `0c1a360`.
@@ -97,7 +105,7 @@ Makelore 在会话恢复、登录和刷新后由 Electron Main 请求 Works `/ap
AI 学习现在是已启用的运营精选项目目录,并继续受登录和 `module_access.learning` 控制。Renderer 通过 Main-owned Host API 获取分页项目卡片和 README 详情;Markdown 支持 GFM、禁用原始 HTML。服务端发布时只校验图片 URL 为无凭据、默认端口、无 fragment 且当前 DNS 结果全部为公网地址的 HTTPS URL,保留地址而不下载、识别格式、转码或镜像;客户端仅为 README 图片节点启用直连,因此 SVG 和 Electron 支持的其他格式可直接显示,单图失败不阻断详情。封面和历史发布媒体继续走受控路径。详情页的下载按钮打开系统保存对话框;Main 将 ZIP 流式写入临时文件,只允许最多五跳同 Works origin 重定向,不校验 `Content-Length`、`archiveBytes`、实际流字节数或客户端大小上限,校验 SHA-256 和 ZIP 签名后原子保存,Renderer 只接收 `saved` 或 `cancelled`。课程生成、进度、本地课程库、OpenMAIC player、Agent、ASR、课堂 runtime、Learning IPC 和 player artifact 打包已删除且没有兼容读取路径;历史课程数据保留但不再读取。服务端和客户端源码契约已完成,不代表生产部署或真实账号安装包联调已经完成。
AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗余历史读取,prompt 可直接进入 Host API;普通历史会话仍刷新消息。每个 Session 独立持有 run、loading、error 与内部队列;一个 Session 的回复或终止不会锁住、改写或重放另一个 Session。Host 接受或用户消息落库不算启动确认,只有明确 busy/retry、assistant、question、permission 或 typed terminal event 才确认/终结启动;独立的 10 秒 watchdog 到期时仅以 `SESSION_START_UNCONFIRMED` 终止该 Session。Main 以 runtime generation provenance、Agent 内容 fingerprint 和 live registry id 共同验证项目 Agent,provider/runtime 或 Agent 未应用时在执行前返回 typed `409` 且 `promptSent:false`。普通 message、command、summarize 和后台 provider sync 不自动重启、reload 或 dispose 共享 runtime;只有显式用户 apply/lifecycle 操作可以推进运行时刷新。Main AI proxy 只把明确的上游分组饱和投影为当前 OpenCode 的终止状态,配额耗尽保持独立终止态,通用限速继续保留 `429`。上下文压缩以每个 Session 的持久时间线事件呈现:自动与手动压缩使用不同文案,运行态原位弱化显示,完成后静态保留并可从历史恢复;`session.compacted` 只完成对应事件,只有真实 idle 才结束 run 和释放排队消息。
AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗余历史读取,prompt 可直接进入 Host API;普通历史会话仍刷新消息。伙伴模型只作为新 Session 默认值,现有 Session 的 active model 由 OpenCode 持有;页面选择器和 `/models` / `/model` 走同一个 native Session 切换动作,后续 prompt、项目命令和上下文压缩不再用伙伴默认值覆盖选择。每个 Session 独立持有 model、run、loading、error 与内部队列;一个 Session 的回复或终止不会锁住、改写或重放另一个 Session。Host 接受或用户消息落库不算启动确认,只有明确 busy/retry、assistant、question、permission 或 typed terminal event 才确认/终结启动;独立的 10 秒 watchdog 到期时仅以 `SESSION_START_UNCONFIRMED` 终止该 Session。Main 按 Agent id 维护 desired/applied 内容状态与 runtime generation provenance;owned fresh generation 中首次出现的唯一 id 可在 live registry 暴露后启用且不阻断已有 Agent,同 id 编辑、删除后重建及 attached/unknown generation 仍保持 pending。provider/runtime 或 Agent 未应用时在执行前返回 typed `409` 且 `promptSent:false`。普通 message、command、summarize 和后台 provider sync 不自动重启、reload 或 dispose 共享 runtime;只有显式用户 apply/lifecycle 操作可以推进运行时刷新。Main AI proxy 只把明确的上游分组饱和投影为当前 OpenCode 的终止状态,配额耗尽保持独立终止态,通用限速继续保留 `429`。上下文压缩以每个 Session 的持久时间线事件呈现:自动与手动压缩使用不同文案,运行态原位弱化显示,完成后静态保留并可从历史恢复;`session.compacted` 只完成对应事件,只有真实 idle 才结束 run 和释放排队消息。
Updater 仍由 Electron Main 选择目标 feed、记录原始诊断并保持失败语义。正式稳定源缺少对应平台 manifest 时,设置页只显示一条简洁中文提示并允许重试,不把缺包误报为已是最新版,也不向普通界面暴露堆栈、URL、路径或错误码;签名产物发布和真实升级安装仍属于外部 Release Gate。
@@ -172,7 +180,7 @@ Robot 绑定设备默认先显示“引导配网 / 已有激活码”路径选
- AI proxy 的明确饱和 `429 → 400` 是与当前 OpenCode 重试契约匹配的内部投影;升级 OpenCode 或上游饱和错误文案变化时必须复核。不得把通用 `429` 或仅含 `rate_limit_exceeded` 的响应误分类为终止饱和。
- AI 编程压缩事件必须按 Session、run token、runtime generation 与 native Part/event identity 关联;`session.compacted` 不等于 `session.idle`,历史 hydration 不得把 completed 降回 running,失败或中止必须清理本 run 的未完成事件。
- AI 编程多 Session 隔离只证明应用提交、状态、错误、超时和队列互不污染,不证明 bundled OpenCode 或真实 provider 会并行执行两个模型 turn。任何产品或性能结论都必须保留上游可能串行、限流或拒绝的边界。
- 项目 Agent 与 provider/runtime freshness 必须在 Main 的 bounded acceptance 临界区内验证。普通 message、command、summarize 和后台同步不得自动重启、reload 或 dispose 共享 runtime;同 id 不能证明同内容已经加载,attached/unknown runtime generation 必须 fail closed。
- 项目 Agent 与 provider/runtime freshness 必须在 Main 的 bounded acceptance 临界区内验证。新增唯一 id 的 live discovery 只在 owned fresh generation 可接受;同 id 不能证明同内容已经加载,删除后重建及 attached/unknown runtime generation 必须 fail closed。普通 message、command、summarize、Session 模型切换和后台同步不得自动重启、reload 或 dispose 共享 runtime。
- AI 绘画单图选择器仍精确匹配 quick reply `从作品列表选择图片`,用途再从当前 Brief medium 推断;本地化或协议文案变化可能破坏入口。扩展更多素材输入前应升级为结构化 action/purpose。
- Updater 源码错误提示不能代替发布正式签名产物;稳定 feed 缺 manifest 必须保持失败,Renderer 不得展示原始堆栈、URL、路径或错误码。升级链只有在旧版本完成发现、下载、重启和安装 smoke 后才可视为生产就绪。

View File

@@ -0,0 +1,46 @@
# Task: Integrate session model and partner hot-add fix
## Identity
- Task ID: 20260820-integrate-session-model-hotfix-7b3e91c4
- Mode: Integration
- Branch: main
- Worktree: D:\Datas\OthersProjects\makelore
- Base commit: 1c6b00443631ad41929e79943bbea9bc7126b563
- Owner: codex
- Status: Blocked
## Scope
- Fast-forward verified source commit `c0163bc` into local `main`.
- Reconcile the canonical OpenCode Session model ownership and per-Agent runtime acceptance documentation.
- Preserve the unrelated untracked packaging task record without modifying or committing it.
## Intent And Constraints
- Keep page and slash-command model switching on OpenCode's native per-Session API; do not rewrite partner/provider configuration or restart the runtime.
- Keep newly created unique-id partners usable after live discovery without weakening same-id content freshness, deletion/recreation, or attached/unknown generation safeguards.
- Merge only to local `main`; do not push.
- Preserve the explicitly adopted pre-existing untracked task record untouched.
## Outcome
- Fast-forwarded local `main` from `1c6b004` to source commit `c0163bc` without conflicts.
- Promoted Session-model ownership, per-Agent acceptance, evidence, current-state, domain, and future verification boundaries into canonical project memory.
## Verification
- Source task verification: 405 focused tests, 176 files / 2068 full unit tests, typecheck, lint with zero errors and six pre-existing warnings, Vite build, and Electron E2E 1/1 all passed.
- Integrated local `main`: `corepack pnpm run typecheck` passed.
- Integrated local `main`: 7 focused unit files / 405 tests passed.
- `git diff --check` passed with line-ending conversion notices only.
- Task-aware documentation drift is blocked by two read-only task records in the base-to-HEAD diff: the explicitly preserved pre-existing untracked record `.project-docs/30-worklog/tasks/20260819-package-learning-off-115-9c4d.md`, and the source task record `.project-docs/30-worklog/tasks/20260820-session-model-agent-hotfix-6e4c9a2f.md` added by source commit `c0163bc`. The integration did not modify either record; deleting or rewriting them would violate the current authorization/source-record boundary.
## Follow-ups
- The pre-existing untracked packaging task record still requires a separate owner decision before this integration worktree can become clean and release ownership.
- The task-aware drift checker also needs an integration-safe way to recognize an unchanged source task record that arrives with the source commit; this task leaves that record read-only as required.
## Promotion Candidates
- Applied the source task's Session-model and per-Agent runtime acceptance candidates; none remain pending for this integration.