文档:集成首次会话延迟修复契约
This commit is contained in:
@@ -12,6 +12,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
|
||||
- `4980894` / `03dae62`:AI 绘画 Enter 发送及同一 Workspace 下的多 Conversation 客户端模型。
|
||||
- `926056a`:Makelore 内置 Electron WebContents/CDP 发布前本地预览检查。
|
||||
- `5b44864`:Main-owned 本地 npm/Vite 构建、同字节 Electron 双视口预检、source+built 双归档与 artifact contract 上传。
|
||||
- `08da976` / `0ee5254`:AI 编程首次发送已知空 session 快速路径与明确上游饱和终止态投影。
|
||||
|
||||
## Current Focus
|
||||
|
||||
@@ -19,6 +20,8 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
|
||||
|
||||
AI 绘画的一个 Workspace 可包含多条 Conversation。消息、Brief、Quote 和 `turnRevision` 随 Conversation 隔离;生成任务和资产保持 Workspace 级共享。每条 Conversation 使用服务端持久 Agent Gateway Session,切换会话只重连对应事件流。
|
||||
|
||||
AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗余历史读取,prompt 可直接进入 Host API;普通历史会话仍刷新消息。Main AI proxy 只把明确的上游分组饱和投影为当前 OpenCode 的终止状态,配额耗尽保持独立终止态,通用限速继续保留 `429`。
|
||||
|
||||
## Recently Completed
|
||||
|
||||
- 2026-08-08:合并登录续期、一键发布和真机预览;发布成功后保存精确 app/version/review 映射,Renderer 不接触 Token、ZIP 或本地路径。
|
||||
@@ -28,6 +31,7 @@ AI 绘画的一个 Workspace 可包含多条 Conversation。消息、Brief、Quo
|
||||
- 2026-08-11:AI 绘画支持在同一设计项目内创建和切换多条独立 Conversation;保留项目级任务/资产,并使用 Workspace + Conversation 身份保护异步与流式更新。退出时关闭本地流并清除本地 Session-id 缓存,不删除服务端持久 Conversation Session。
|
||||
- 2026-08-12:一键提交前复用当前项目的内置浏览器 loopback preview,以 fresh 临时 Electron WebContents/CDP 执行桌面/移动 UX 预检;服务端仍执行唯一受控构建、不可变 Release 安全门禁和人工审核。
|
||||
- 2026-08-12:发布架构反转为 Main-owned 本地构建;固定 npm 11.6.2 按项目 lockfile 安装并执行项目 Vite,Electron 预检最终上传同字节产物,再上传 source+built 双归档和严格 contract。服务端仅校验并固化不可信字节,不再承担项目 Vite 构建。
|
||||
- 2026-08-12:AI 编程新 session 的首条 prompt 不再被已知空历史读取阻塞;明确上游分组饱和会快速终止,通用 `429` 仍保持原有限速语义。
|
||||
|
||||
## In Progress
|
||||
|
||||
@@ -57,6 +61,7 @@ AI 绘画的一个 Workspace 可包含多条 Conversation。消息、Brief、Quo
|
||||
- AI 绘画消息、Brief、Quote 和 `turnRevision` 必须按 Workspace + Conversation 隔离;任务事件仍按 Workspace 归并,迟到的异步结果不得污染已切换的会话。
|
||||
- 服务端持久 Conversation Session 不由客户端在注销或退出时删除;Main 只关闭本地流、清除本机缓存并撤销本地凭据。
|
||||
- 客户端对最终构建字节的 loopback 检查没有可信 receipt,且不复刻生产 opaque-origin;服务端必须独立重算 source/built/contract、校验不可变 Release,人工审核仍不可绕过。如未来需要不可绕过的 runtime gate,必须引入可信 verifier 并绑定精确构建产物。
|
||||
- AI proxy 的明确饱和 `429 → 400` 是与当前 OpenCode 重试契约匹配的内部投影;升级 OpenCode 或上游饱和错误文案变化时必须复核。不得把通用 `429` 或仅含 `rate_limit_exceeded` 的响应误分类为终止饱和。
|
||||
|
||||
## Last Updated
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Task: Integrate first conversation latency fix
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260812-integrate-first-chat-fix-c31e
|
||||
- Mode: Integration
|
||||
- Branch: codex/20260812-integrate-first-chat-fix-c31e-integrate-first-chat-fix
|
||||
- Worktree: D:\Datas\OthersProjects\makelore-integrate-first-chat-fix-c31e
|
||||
- Base commit: a7340a20a1183550be3f70067611b6fa0ef5bef8
|
||||
- Owner: codex
|
||||
- Status: Completed
|
||||
|
||||
## Scope
|
||||
|
||||
- Merge source commit `08da976` into the latest clean `main` baseline `a7340a2` through this isolated integration branch.
|
||||
- Preserve the first-send known-empty session fast path, the narrow upstream-saturation terminal projection, and their focused unit/Electron E2E coverage.
|
||||
- Promote the durable session-cache and Host AI proxy contracts into canonical project memory, then advance `main` only after verification and independent review.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Treat source task `20260812-first-chat-fix-b84fd29c` as read-only evidence; do not rewrite its record during integration.
|
||||
- Preserve the existing Renderer -> Host API -> Electron Main -> OpenCode ownership boundary and generic `429` behavior.
|
||||
- Do not claim that every source of cold-start latency is eliminated: this integration removes the redundant known-empty history wait and stops indefinite retries only for explicitly classified upstream saturation.
|
||||
- Preserve `main` commit `a7340a2` and all unrelated in-flight task work; no remote push is authorized by this task.
|
||||
- Revalidate the status projection whenever the bundled OpenCode retry contract changes.
|
||||
|
||||
## Project Context Loaded
|
||||
|
||||
- `.project-docs/05-agent-entry/memory-index.md`
|
||||
- `.project-docs/30-worklog/current-state.md`
|
||||
- `.project-docs/00-brief/project-positioning.md`
|
||||
- `.project-docs/10-decisions/decision-index.md`
|
||||
- `.project-docs/20-architecture/system-overview.md`
|
||||
- `.project-docs/20-architecture/module-map.md`
|
||||
- `.project-docs/20-architecture/data-flow.md`
|
||||
- `.project-docs/40-domain/business-rules.md`
|
||||
- `.project-docs/00-brief/success-criteria.md`
|
||||
- `.project-docs/50-evidence/evidence-index.md`
|
||||
- `.project-docs/60-reflection/reflection-index.md`
|
||||
- `.project-docs/80-commitments/commitments.md`
|
||||
- `.project-docs/90-maintenance/stale-items.md`
|
||||
- `.project-docs/05-agent-entry/integration-gate.md`
|
||||
- Source task record `20260812-first-chat-fix-b84fd29c`
|
||||
- Active peer task Scope / Intent And Constraints / Promotion Candidates sections required by the planning gate.
|
||||
|
||||
## Plan
|
||||
|
||||
1. Merge `08da976` without rewriting source history and inspect the combined diff against `a7340a2`.
|
||||
2. Record the durable OpenCode session-cache and Host AI proxy contracts in canonical memory.
|
||||
3. Run focused unit tests, typecheck, scoped lint, Vite build, Electron E2E, full-suite baseline comparison, and documentation checks.
|
||||
4. Obtain an independent read-only PASS/FAIL review, complete integration documentation, and fast-forward `main` through a clean promotion task.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Merged source commit `08da976` into the latest `main` baseline with integration merge `0ee5254`, preserving both parents while keeping the source task record read-only on its source branch.
|
||||
- Integrated the known-empty session fast path: first prompt submission no longer waits for a redundant empty-history request, while unknown and ordinary historical sessions retain defensive loading/refresh behavior.
|
||||
- Integrated the narrow Host AI proxy saturation projection: quota exhaustion remains `402`, explicit upstream-group saturation becomes terminal `400` for bundled OpenCode 1.18.9, and generic rate limits remain `429`.
|
||||
- Promoted the session-cache own-key contract, proxy retry boundary, verification evidence, and OpenCode-upgrade revalidation commitment into canonical project memory.
|
||||
|
||||
## Verification
|
||||
|
||||
- Focused unit tests: 4 files / 228 tests passed.
|
||||
- `pnpm run typecheck`: passed.
|
||||
- ESLint over all changed product, unit, and Electron E2E files: passed.
|
||||
- `pnpm run build:vite`: passed for Renderer, Electron Main, and Preload.
|
||||
- `pnpm exec playwright test tests/e2e/opencode-first-chat.spec.ts`: passed, 1/1 in 4.7 seconds on the stable build output. An earlier attempt ran concurrently with `build:vite` and timed out during Electron launch before test logic; the serial rerun passed.
|
||||
- `pnpm test`: 1548/1551 tests passed. The same three failures were independently reproduced on pre-integration `main`: two timing/generation cases in `opencode-manager.test.ts` and the missing repository `.opencode/agent` fixture in `youth-plain-language-skill.test.ts`.
|
||||
- `check_project_docs.py`: passed.
|
||||
- `check_doc_drift.py --task-id 20260812-integrate-first-chat-fix-c31e`: passed after the integration merge was amended so the source task record remains only in source history.
|
||||
- `git diff --check`: passed with only the repository's normal LF/CRLF checkout warnings.
|
||||
- Independent final read-only Sol review: PASS with no blocking findings; it independently reran all 228 related unit tests and confirmed merge ancestry, source-tree equality, cache/error semantics, and canonical documentation accuracy.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Revalidate or remove the internal saturation status projection when bundled OpenCode or the upstream error contract changes.
|
||||
- Treat duplicate cold bootstrap work and coarse global loading state as separate optimization candidates; this integration does not claim that all runtime cold-start latency is eliminated.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- None recorded.
|
||||
Reference in New Issue
Block a user