docs(architecture): audit Model access group against implementation - #4794
Conversation
Audit the two Model access documents from the apache#3522 documentation audit against the current implementation. openai-responses-incremental-transport.md: every named symbol resolves in the current source (session-fallback promptCacheKey with explicit value winning, turn-scoped continuation lane, endLane release, the five-minute cross-turn socket cooldown, the sdk.response.messages replay contrast). No drift; added the standard frontmatter with last_verified. model-metadata-firstscreen-optimization.md: the described optimization is implemented (onboarding:getSnapshot projection, conservative hasSecret:false, metadata-free onboarding hero copy, startup chain verified metadata-free), so the Problem section is now explicitly marked as the 2026-08-04 pre-optimization record in both languages. Fixed the cited renderer file name chat-model-selection.ts to the actual shell-chat-model-selection.ts. Added the standard frontmatter. The drift-grep recipes from the tracking issue return zero matches in both documents. Refs apache#3522 Generated-by: GLM-5.3-Flash (ZCode)
e97d75d to
039e93e
Compare
hqhq1025
left a comment
There was a problem hiding this comment.
Reviewed exact head 039e93edcae16a0fe37b47f9bb72013ccb4e74a8.
Actual change: adds architecture-document metadata/status text and updates one renderer dependency name. I checked both documents against the exact-head implementation, the current main dependency graph, and the generated renderer architecture ledger.
Validation: hosted test is green; check:asf-headers, check:renderer-architecture, focused Biome formatting, and git diff --check pass. The semantic-continuation unit suite passes 8/8. A broader local runtime build and the WebSocket/model-adapter suites could not run under the reused dependency tree because it has unrelated dependency/type mismatches (@slack/socket-mode missing and an incompatible https-proxy-agent export); I did not treat that local environment failure as PR evidence.
I found two documentation correctness issues inline. I did not independently reproduce the historical startup-size/cold-start measurements.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
hqhq1025
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 9ffe10a8b003e0d70649eb76fd438ba4514624df after the merge from main.
The two P2 documentation findings remain on this head:
docs/model-metadata-firstscreen-optimization.md:94and:169still claim that the startup path excludesshell-chat-model-selection.ts, butapp-shell.tsx:216importsuseShellChatModel, which imports that selector atuse-shell-chat-model.ts:37; the current renderer architecture ledger records the edge.docs/architecture/openai-responses-incremental-transport.md:36still describes complete-history upload on every step in present tense while marking the implementation current. The exact-head adapter still plans semantic continuation, selects the suffix, and sends delta input over a matching Responses WebSocket.
The merge commit did not change either PR document relative to the previously reviewed commit; it only brought the branch onto current main. The existing inline threads remain applicable and are not duplicated here.
Validation: hosted test passed on this exact head; renderer architecture passed 101/101; ASF headers and git diff --check passed; the continuation/WebSocket/model-adapter suites passed 28/28 using built artifacts whose relevant source files are byte-identical to this head. The exact-head Runtime build remains blocked in the reused dependency tree by unrelated missing/incompatible dependencies (@slack/socket-mode and https-proxy-agent). I did not reproduce the historical startup performance measurements.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
…em historical Two review (hqhq1025) findings on this audit: - model-metadata-firstscreen-optimization.md claimed the startup path no longer statically depends on shell-chat-model-selection.ts, but app-shell.tsx imports useShellChatModel, which statically imports that selector (use-shell-chat-model.ts). The selector is the lightweight piece the optimization intentionally keeps; only the heavy metadata modules and model-catalog-choices.ts moved off the startup path. State that boundary in both the English and Chinese criteria. - openai-responses-incremental-transport.md declared current status while its Problem section stayed in present tense. Add the same implemented-status banner the sibling document uses, marking the Problem text as the pre-optimization record. Generated-by: GLM-5.3-Flash (ZCode)
hqhq1025
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 5399a7afba0bfadffd3a5f8a81a8acf9ec31bc2f.
The two previous P2 documentation findings are fixed on this head:
docs/model-metadata-firstscreen-optimization.mdnow accurately states thatshell-chat-model-selection.tsintentionally remains on the static startup path as the lightweight selector behinduseShellChatModel; the optimization boundary excludes the heavy metadata/catalog modules instead.docs/architecture/openai-responses-incremental-transport.mdnow marks the Problem section as a historical pre-optimization description and identifies the implemented semantic-continuation and suffix-delta path.
I found no remaining P0-P3 issues. The incremental commit changes only those two documents; the referenced Desktop and Runtime sources are unchanged from the previously inspected head. Hosted test passed on this exact head. Renderer architecture passed 101/101 against the PR base, ASF headers and git diff --check passed, and a synthetic merge onto current main (12ebc45e6fe43b2eebd7dfe61f5c1fa92c0c873a) was clean with an unchanged PR patch. Markdown remains outside the repository's Biome formatting scope. I did not reproduce the historical startup-performance measurements or rerun the full Runtime transport suite for this docs-only correction.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the update. Additional independent review of 5399a7afba0bfadffd3a5f8a81a8acf9ec31bc2f: the earlier corrections are present, but one remaining startup dependency contradicts the completed optimization status. A separate, lower-priority transport eligibility omission is also inline. These are documentation findings; this PR does not introduce a runtime regression.
AI disclosure: Codex agents performed this review; the coordinating agent checked the cited evidence. This is not an independent human review.
中文说明
此前两处修正已经在当前提交中;本轮另外发现首屏静态依赖仍存在,完成状态不准确,以及一处 transport 适用范围遗漏。均为文档问题,不是本次引入的运行时回归。
…rt exclusion Two findings from the follow-up review on apache#4794: - The firstscreen-optimization status claimed every startup transitive metadata dependency was cut, but the command palette still reaches `@maka/core/provider-registry` (and `model-metadata.generated`) statically via `isRetiredProvider` from `command-palette-commands.ts` through `useAppShellCommands`. Record that path as accepted debt and qualify the completed status in both languages. - The incremental-transport rollout excludes connections with request customizations (`hasRequestCustomization` bypasses the transport wrapper), which the current-state description did not mention. Add the exclusion and refresh `last_verified` on both documents. Generated-by: GLM-5.3-Flash (ZCode)
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the change. Approving exact head 09dfe11d85db463b078387870fb03c5e9f29344e following the completed review and Astro-Han’s explicit acceptance of this merge batch. Current checks pass and no review threads remain unresolved.
Align model-access documentation with implemented Responses continuation and startup behavior. Explicitly retain the command-palette metadata dependency as an incomplete acceptance boundary and document customized-request transport exclusions. Documentation only; remaining runtime debt is not claimed fixed.
AI assistance: Codex performed the review and final-state verification; Astro-Han authorized approval and merge.
中文
感谢改动。基于已完成的审查和 Astro-Han 对本批次的明确认可,批准当前精确 head;检查通过,讨论已结清。此前说明的验证边界与后续事项保持不变。本次由 Codex 执行审查和状态核对,Astro-Han 授权批准与合并。
Summary
Audits the Model access group (2 documents) from #3522 against the current implementation, one PR for the group as requested.
docs/architecture/openai-responses-incremental-transport.md— every named symbol resolves in the current source: the session-fallbackpromptCacheKey(maka:${sessionId}) where an explicit caller value wins (packages/runtime/src/openai-responses-continuation.ts:99), the turn-scoped continuation lane inModelAdapter(model-adapter.ts:145),endLaneand the five-minute cross-turn socket cooldown (openai-responses-websocket.ts:118,34), and thesdk.response.messagesreplay contrast (openai-responses-continuation.ts:37). No drift found, so the only change is the standard frontmatter withlast_verified.docs/model-metadata-firstscreen-optimization.md— the described optimization is implemented:onboarding:getSnapshotexists, the credential projection is conservativelyhasSecret: false(onboarding-service.ts:217), the onboarding hero copy is metadata-free, and the renderer startup chain (app-shell.tsx→use-shell-chat-model.ts→shell-chat-model-selection.ts) carries no runtime metadata import;PROVIDER_REGISTRYremains only under lazy settings paths. The Problem section is therefore now explicitly marked as the 2026-08-04 pre-optimization record, in both languages. One real drift fixed: the cited renderer filechat-model-selection.tsis actuallyshell-chat-model-selection.ts.The drift-grep recipes from the tracking issue (
run\.json,events\.jsonl,runtime-events\.jsonl,PermissionEngine,respondToPermission,agent-run-store\.test\.ts) return zero matches in both documents.Verification
git diff --staton this branchnpm run format:checknpm run check:asf-headers.gitkeepscratch file, not part of this PRpackages/runtime/srcapps/desktop/src/renderershell-chat-model-selection.tshas zero non-type importsLeft untouched on purpose: the point-in-time records (the 2026-08-04 chunk-size tables; the "34 passed" and "3,217 tests" runs in the OpenAI doc's Verification outcome) are historical results of earlier runs and stay as written.
AI use
Prepared with ZCode (GLM-5.3-Flash): the agent read both documents and the current source, traced each claim above to files and lines, and drafted the edits. The commit carries the
Generated-bytrailer.Checklist
Refs #3522in the commit messagetranslation_status: synced)last_verifiedset to the audit date (2026-09-04)