Merge latest main and preserve teacher upgrade safeguards
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
鲨鱼辣椒
2026-09-28 18:42:04 +08:00
28 changed files with 1435 additions and 93 deletions

View File

@@ -0,0 +1,87 @@
# Task: Diagnose truncated consultation reply and raw-content fallback
## Identity
- Task ID: 20260928-agent-reply-truncation-c812b59f
- Mode: Feature
- Branch: codex/20260928-agent-reply-truncation-c812b59f-agent-reply-truncation
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260928-agent-reply-truncation-c812b59f
- Base commit: 4495345fb0a9ea1abef8e603629ce9b51d73eb05
- Owner: codex
- Status: Ready for Integration
## Scope
- Diagnose and repair the screenshot showing only a short prose fragment followed by a legacy parse-failure notice and raw structured output.
- After diagnosis, user authorized the three repair paths: conservative full-prose recovery, independent auxiliary-field fallback plus explicit manual retry, and passive recovery of retained history.
## Intent And Constraints
- Initial investigation was read-only. The later implementation is explicitly authorized; keep local raw evidence and avoid automatic model replay, live app restart, cloud edits, or deployment. The earlier main merge/push request covered the completed Agent refresh feature.
- Latest user constraint: no subagents. Remaining code review, changes and verification are performed by the primary agent; earlier partial subagent work was reviewed locally.
- Ownership and planning gates passed in this task checkout. Reused unchanged canonical context from the prior turn; read all current peer task scopes. Current trial Main 9adab45 / Renderer cb48f60 belongs to the separate reply-cleanup task and is distinct from main 4495345. Inspected committed code only; peer working files remain untouched.
## Outcome
- The three approved repair paths are implemented and locally verified: conservative full-prose recovery, explicit incomplete-reply handling/manual retry, and passive retained-history recovery. The running client remains unchanged.
- Implementation and final validation are recorded below; the following investigation notes preserve how the original diagnosis was established.
### Initial Diagnosis
- The screenshot notice maps to the legacy structured-response parse fallback. The UI retains unparsedResponse separately from the recovered prose, so content in the raw box was received even though normal presentation failed.
- Independently reproduced an exact-shape failure: an unescaped ASCII quote after the opening prose causes JSON parsing to fail, while stringToken/recoverReply accepts only the prefix as a complete reply. The old parser returns the same short-prefix + screenshot notice combination. The newer shared/teacher-reply fields recovery in committed 9adab45 still accepts the same premature prefix.
- This is a demonstrated mechanism, not a confirmed trace of the screenshot request. The exact question/response was not found in the known trial/installed-app project teacher histories. The screenshot shows only the tail of the raw output, so its precise triggering bytes and provider termination reason remain unknown.
- Cloud structured replies use completed run.output; missing intermediate stream deltas do not explain a complete raw body being cut by this recovery path. Do not claim all provider truncation/format causes are excluded.
## Verification
- Final implementation checks: 329 unit checks, 17 headless UI cases, typecheck, scoped ESLint and production compilation passed. Native Electron case added and enumerated but not executed. The inherited dependency-document drift finding remains disclosed below.
### Initial Investigation Verification
- Read old shared/teacher-discussion.ts stringToken/recoverReply/parser fallback, UI diagnostics rendering, service/discussion persistence and cloud-runner final-output handling.
- Independent agent performed an in-memory execution of both committed parsers with malformed quoted prose and reproduced the truncated prefix. No tests or product files added/modified.
- Inspected only relevant local app runtime descriptors/project catalogs and teacher conversation records to seek the screenshot request; no matching request found. No credentials read or emitted.
- Project-document structure, task ownership drift and whitespace checks passed.
## Follow-ups
- The requested repair is complete; integrate and update the running client as a separate next step. Provider byte-level correlation remains unavailable; retain the screenshot-level evidence boundary.
## Promotion Candidates
- See Repair Follow-ups And Promotion Candidates below. Initial diagnosis introduced no accepted behavior change; the later repair was approved by the user.
## Agent Log Screenshot Follow-up
- Same-task start/status matched; reused unchanged project context and reviewed the new welcome-diagnosis/latest cleanup peer scope. Read-only gate passed; no product or live state edits.
- User supplied an Agent log screenshot containing the visible prefix `{"reply":"它早就不是"刚搭好架子"那种阶段了——` followed by a substantial prose answer and legacy structure payload. The earlier client screenshot shows exactly the prose prefix 它早就不是, the legacy fallback notice, and the later tool payload in the raw-content box.
- Independent reviewer replayed the visible prefix in memory against the old discussion parser and committed 9adab45 reply parser. Both cut at precisely the same quote. Together the screenshots locate the observed short-body symptom to malformed-format handling/recovery, strongly contradicting a stream that delivered only the first few characters.
- Distinguish upstream malformed structured output from downstream unsafe recovery: model-produced internal quotes need valid encoding, and the client must not accept an ambiguous prefix as complete prose. This is parsing before rendering, rather than visual clipping.
- Evidence remains screenshot-level, not a request-correlated byte capture. A log renderer could alter escape display, so do not claim the full transport was byte-for-byte audited or all possible transport issues were excluded. No corrective code had been applied at this diagnostic stage; the approved implementation is recorded below.
## Approved Repair Implementation
- Same-task ownership and planning gates passed on resume; registry remains this task / feature / owned worktree and branch. Merged the committed current reply-only dependency `40c247a` through `dda2f0a` so the fix applies to the current consultation implementation. No peer working files or canonical documents were edited; protocol-boundary and welcome/child-language changes were not imported.
- Prose extraction now requires a credible field boundary. Internal unescaped quotes and literal control characters are repaired only inside the prose field and only when the entire repaired envelope parses. Ambiguous boundaries, duplicate bodies and missing body endings fail visibly; missing content is never guessed. Ordinary Markdown, escaped code and Unicode remain intact.
- Complete prose survives malformed or truncated auxiliary data. Replies without trustworthy complete prose get `replyIncomplete`; UI shows an explicit incomplete state and a manual retry, never the half-sentence as a finished answer. Raw diagnostics stay folded and inert, including when escaping was successfully repaired. Technical output instructions require proper JSON string escaping without changing the published persona.
- Manual retry reuses original text, intent, references, source, topic and published version; an accepted completed turn gets a new request identity, uncertain resends reuse their identity. Click guarding prevents duplicate sends. Both current text/references and edits made while awaiting the send response survive. Project-only history does not substitute a different source or send the `project` sentinel as a conversation id. Disabled/legacy Agents and check-ins cannot be retried as ordinary questions.
- Store reads repair eligible completed history from retained original content locally. Valid unrelated prose is not replaced by a different recovered answer. Failed/cancelled/interrupted/running replies are never promoted to success. The projection preserves raw data, opaque legacy fields, accounting, request status and topic metadata; no model call or repair-only disk write occurs. In mixed history, restart recovery is persisted before applying the display projection. Incomplete assistant content and suggestions are excluded from both compiled model context and read_conversation while the user's original question remains available.
## Implementation Verification
- Focused parser, history and Renderer unit suites: 153/153 passed.
- Related service/cloud/model/read-tools/guidance/retired-route/activity suites: 176/176 passed (329 unit checks total).
- Typecheck and scoped ESLint passed. Production Renderer/Main/Preload/worker compilation passed (`build:vite`); build artifacts remain ignored.
- Headless Chrome layout/interaction suite: 17/17 passed, covering 319px and 508px widths, complete screenshot-shaped prose, incomplete manual retry, original input retention, no automatic send, draft retention and legacy-history behavior. Personally inspected narrow-panel recovered/incomplete screenshots. Initial browser run could not launch because the Playwright bundled binary was absent; reran successfully using the already-installed Chrome channel.
- Added an Electron integration case for click-only retry and preservation of both main and consultation drafts. Native Electron case was not run because the existing fixture shows/focuses an app window; keep the user's no-focus workflow intact. Browser interaction and backend history tests passed independently; do not claim a native smoke or a real-provider end-to-end run.
- Current live client was not replaced/restarted; code is ready for integration and a subsequent app update. Tests use deterministic local fixtures and do not consume paid model calls or modify real conversation history.
## Documentation Boundary Note
- Project-document structure check passed. The task-aware drift checker reports the already-committed cleanup task record as foreign relative to the original `4495345` base because this task merged the required reply-only dependency. That record is byte-identical to dependency `40c247a`; no owned-work edits touch it. Do not rewrite or delete the peer record, falsify the recorded base, or claim this inherited checker finding passed. All implementation-era document edits are limited to this task record and product README.
## Repair Follow-ups And Promotion Candidates
- Integrate the tested repair branch, then update the user's running client when requested. Exact historical screenshot request was not located locally; fixture tests reproduce the visible triggering bytes, not a provider trace.
- Candidate for the canonical current-state/consultation architecture at integration: preserve trustworthy full prose independently of auxiliary data; flag ambiguous incomplete prose explicitly; user-triggered retries preserve original scope and draft; retained raw data permits local history repair without replay. Evidence: focused unit and headless UI checks above. Future impact: any new reply format/history migration must retain the same safety properties. No change to published persona, model billing boundary or retired component policy; no additional product decision required beyond the user's approved repair.

View File

@@ -0,0 +1,60 @@
# Task: Merge current completed Makelore changes into main and push
## Identity
- Task ID: 20260928-latest-main-merge-b6a42f90
- Mode: Feature
- Branch: codex/20260928-latest-main-merge-b6a42f90-latest-main-merge
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260928-latest-main-merge-b6a42f90
- Base commit: a21a1f077cc11976213290a6b843bb74be97ab44
- Owner: codex
- Status: Ready for Integration
## Scope
- Integrate current completed product work into origin/main, adapt overlaps, verify, fast-forward local main and push without force.
## Intent And Constraints
- User explicitly requested all latest project code merged and pushed. No subagents, paid model calls, app restart or cleanup. Preserve foreign working trees and original source records. Canonical memory reconciliation is not included; its integration lock is held by another task.
## Outcome
- Merged completed product sources with merge ancestry preserved: reply cleanup/recovery `d530abe` (including `40c247a`) via `d032425`; cloud-owned teaching policy and 0–3 new shortcuts `54a40d2` via `65a0c21`; welcome dismissal `c96bb45` via `44b16f8`. Base `a21a1f0` already contains continuous account/Agent conversations, manual refresh and hover UI.
- Adapted recovery to per-turn continuous storage, including older pages and read-only history tools; uncertain legacy index excerpts cannot leak partial answers. Display repair leaves completed turn files unchanged, including when another turn needs restart recovery.
- Incomplete replies retry only on deliberate click, retaining the original problem/references and both drafts. Continuous retries require the original project/source; each newly accepted turn still resolves the current published version. Legacy pinned-version behavior remains compatible.
- Persisted rejection of excessive new shortcuts so a later history repair cannot restore them; historical cards remain preserved. Removed retired discussion rendering/state updates while retaining opaque source archives. Welcome dismissal follows current account-wide scope.
- Refreshed README and combined unit/browser/native-E2E fixtures. Product merge `cafebca05710b7bf1a6fa62ec51be4992a73a18c` was fast-forwarded into local main and pushed normally; `git ls-remote origin refs/heads/main`, origin/main and local main matched with a clean checkout. No app restart, model call, dependency change or worktree cleanup.
## Verification
- Passed: 405 focused unit tests in 14 files, covering parser, history, service, continuous conversations, UI, cloud/model/read contracts, refresh, welcome and preview. Command: `corepack pnpm exec vitest run tests/unit/teacher-reply.test.ts tests/unit/teacher-reply-history.test.ts tests/unit/coding-teacher-ui.test.tsx tests/unit/teacher-conversation.test.ts tests/unit/teacher-conversation-panel.test.tsx tests/unit/coding-teacher.test.ts tests/unit/teacher-companion.test.tsx tests/unit/coding-teacher-cloud.test.ts tests/unit/coding-teacher-model.test.ts tests/unit/coding-teacher-read-tools.test.ts tests/unit/teacher-guidance.test.ts tests/unit/teacher-retired-discussion-route.test.ts tests/unit/teacher-cloud-activity.test.ts tests/unit/agent-browser-panel.test.tsx --maxWorkers=2`.
- Passed: 28 headless browser cases via installed Chrome, including legacy/continuous quote recovery and retry at 319px/508px, draft retention, rich reply containment, archived component suppression and preview layout. Command: `MAKELORE_LAYOUT_BROWSER_CHANNEL=chrome corepack pnpm exec playwright test tests/e2e/teacher-reply-layout.spec.ts tests/e2e/teacher-preview-layout.spec.ts --max-failures=1`.
- Passed: `corepack pnpm run typecheck`, scoped ESLint for changed implementation/tests, `corepack pnpm run build:vite`, and `git diff --check`. Native Electron E2E additions parse/list successfully but were not executed because the fixture opens a foreground app window; the current client was left running unchanged.
- Passed: required project-document structure; every selected source is an ancestor of the merge candidate. Re-fetched remote main remains `a21a1f0`.
- Drift checker reports the four committed source-task documents as foreign relative to the task's original base. These are imported by the explicitly requested source merges, not edited by this task. Byte comparison against `d530abe`, `54a40d2`, `40c247a` and `c96bb45` confirms all four unchanged; only this task's own record is authored here. No canonical document changes, altered baseline or ownership override used to suppress this inherited checker finding.
## Follow-ups
- Product publication complete; source and integration worktrees retained.
- Full native Electron interaction execution and release packaging remain outside this merge validation; no claim of a rebuilt running client.
## Promotion Candidates
- A later canonical-memory integration can reconcile retired discussion UI descriptions with the current README and continuous-chat/reply-recovery contracts; this task does not hold that integration lock or edit those canonical sources.
## Project Context Loaded
- Task ID/mode/branch/worktree/base: verified against official start/status; feature `20260928-latest-main-merge-b6a42f90`, branch `codex/20260928-latest-main-merge-b6a42f90-latest-main-merge`, this absolute worktree, fetched base `a21a1f077cc11976213290a6b843bb74be97ab44`.
- Managed app worktree creation was unavailable because the chat root is the repository parent; official skill start created and registered isolation from the explicit remote base.
- Read: entry order, memory-index in 05-agent-entry, own record, positioning, latest current-state/teacher ADR/decision index, architecture, domain/success criteria, relevant evidence/reflection/commitment/stale indexes, and all registered peer Scope/Intent/Promotion sections.
- Project goal: cloud-configured domain Agents support student projects; Main owns calls, source scope and persistence. Current remote main already implements account/Agent continuous chats, per-turn project/source/version, shared manual refresh and hover UI. No fixed local persona, deleted component UI or old topic controls should reappear.
- Local current product sources: reply cleanup and truncation fix `d530abe` (includes `40c247a`); technical prompt boundary `54a40d2` supersedes older Alice audit `89c913b`; welcome-entry fix `c96bb45`. Other feature branches are ancestors of main, diagnostic-only, or superseded experiments. Old dirty teacher-components and trial launcher are known historical work and remain excluded/read-only; child-language task has only an unfinished task record and no product code.
- Overlap: remote continuous-chat storage/send/history needs the same repair, retry and retired-component behavior as legacy topics. Resolve mechanically while preserving the accepted single-chat/per-turn rules. The old retry's pinned-topic assumption must not reverse the newer per-turn current-version contract.
- Canonical docs contain historical component descriptions; README will describe the combined implementation. Existing canonical integration lock and source task records remain untouched. No new semantic decision needed; gate Passed.
## Plan
1. Merge the committed reply, prompt-boundary and welcome changes into fetched remote main; resolve overlapping code and adapt continuous-chat paths.
2. Add focused regressions for the combined storage, context and UI paths; run relevant tests, typecheck, lint and build plus headless UI where available.
3. Verify committed source coverage, record outcomes, fast-forward clean local main, push normally and compare remote identity. Keep all worktrees.

View File

@@ -20,21 +20,27 @@
## Outcome
- Source cleanup merged locally with continuous-chat conflict resolutions; latest remote advanced during verification and is being incorporated before publication.
- Source cleanup `40c247a` merged with the current account/Agent continuous-chat behavior in `581ebc8`, then incorporated complete remote main `077184a` before publication. Preserve its reply recovery, cloud-owned teaching policy, 0–3 new shortcuts, welcome dismissal, pagination and per-turn source/version behavior.
- Additional merge safeguards: old component mutation route removed from the continuous API; no new per-project component state is created or imported; existing malformed legacy component archives are retained verbatim. Old component instructions cannot persist through a reused pre-upgrade cloud checkpoint: first reply-protocol turn rotates the internal thread and carries bounded public reply history, without changing the visible chat.
- Unconfirmed legacy hint requests retain their old text, ID and original project/source. Migrated per-project drafts keep that original scope; cross-project or cross-source hint retry waits for the original scope instead of issuing another charge. Existing send-in-flight and incomplete-reply retry safeguards remain intact.
- No package, app restart/update, cloud configuration publication, paid model call or desktop focus change. Source/live-trial and all foreign worktrees remain intact. Publication verification is recorded below after the normal push.
## Verification
- Initial merge: typecheck and production Vite build passed; lint passed with 8 existing warnings. Focused backend/context/parser/browser tests 186 passed; backend overlap suites 169 passed; UI suites 127 passed and after extra regressions UI suite 61 passed; headless layout 15 passed. These overlapping runs are not an additive unique-test count.
- Project structure checker passed. Drift checker reports the source cleanup task record as foreign because the merge imports it unchanged; no source record or canonical file was authored here.
- Remote main moved from a21a1f0 to 077184a and already includes source 40c247a plus independently integrated reply recovery, protocol boundary and welcome fixes. Preserve that full main and add only necessary overlap safeguards before final revalidation.
- Final `corepack pnpm run typecheck`, `corepack pnpm run lint:check` and `corepack pnpm run build:vite` passed. Lint has 8 existing unrelated warnings; build has existing chunk-size/dynamic-import warnings. No dependencies or build outputs committed.
- Final backend focused validation: 7 suites / 261 tests passed; UI/companion/chat: 4 suites / 144 tests passed; continuous storage/retired routes: 2 suites / 17 tests passed. These runs overlap and are not an additive unique-test count.
- Headless Chrome: all 28 teacher reply/preview layout cases verified. First run passed 27; one initial Vite scan observed an in-progress shared-type merge marker, then passed when rerun after resolution. Native Pi Electron E2E fixture parses and lists 19 tests; not launched because it opens a foreground app.
- Full `corepack pnpm test`: 261 files / 2639 tests passed, 3 tests skipped; 3 failures in 2 unrelated Pi files. Independently reproduced exactly those same 3 failures on a disposable archive of original remote `077184a` (12 passed / 3 failed in the selected two files): two event-projector old error-message assertions and the managed-worker opener runtime-v6/v7 assertion. Baseline log: `/tmp/makelore-baseline-077184a-21n6od02/baseline-tests.log`. The script's separately gated pressure suite was then run manually and passed 1/1.
- `git diff --check`, required project-document structure and semantic comparison against latest remote passed. Task drift checker reports 5 imported source-task documents as foreign relative to the original base; byte comparison against `077184a` confirms every imported document unchanged. Only this task's own record is authored here; no canonical writes, ownership override, baseline alteration or source-document edits were used to suppress the inherited diagnostic.
## Follow-ups
- None recorded.
- Push the verified merge normally to remote main and record exact publication identity. Packaging and installation belong to the user's colleague.
- The 3 pre-existing Pi test assertions remain outside this teacher merge scope. Native Electron foreground interactions and signed package verification are not claimed.
## Promotion Candidates
- None recorded.
- A later canonical-memory integration should reflect current text/quick-reply-only teacher behavior and first-upgrade cloud-thread rotation. Evidence is the merged implementation, focused regressions and baseline comparison; existing cloud-defined policy and continuous-chat decisions remain unchanged. This feature task does not own the canonical integration lock.
## Project Context Loaded

View File

@@ -0,0 +1,62 @@
# Task: Keep teacher runtime instructions scoped to entry facts and UI protocol
## Identity
- Task ID: 20260928-teacher-protocol-boundary-f2c8a601
- Mode: Feature
- Branch: codex/20260928-teacher-protocol-boundary-f2c8a601-teacher-protocol-boundary
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260928-teacher-protocol-boundary-f2c8a601
- Base commit: 998796d77cba146ae2a007cbebfdaa1255a3413e
- Owner: codex
- Status: Ready for Integration
## Scope
- Continue the accepted teacher/client boundary on top of completed legacy-component cleanup commit `998796d77cba146ae2a007cbebfdaa1255a3413e`.
- Keep entry markers factual and the reply protocol technical. Remove locally appended teaching strategy from active help, guided help, background checks, and reply-format instructions.
- Enforce the current 0–3 shortcut capacity for newly generated answers while preserving archived replies and exact diagnostics.
- Update focused tests and README; preserve card styling and existing interaction/scheduling machinery.
## Intent And Constraints
- User assigned main merge and push to another conversation. This task stays in its isolated feature branch and prepares a tested commit for integration.
- Cloud configuration owns Alice's teaching purpose, focus, tone, length, and shortcut prefixes; the host owns invocation facts, available context/tools, and interface protocol.
- Keep old component cleanup intact. Do not merge the older `89c913b` patch wholesale because it modifies a superseded protocol.
- No cloud configuration publishing, live app restart, scheduler redesign, or teacher-to-operator consensus handoff in this task.
- Gate passed before edits: task ownership/status verified; entry, task-relevant memory, and peer scopes reviewed. Relevant canonical documents are unchanged between the previously read baseline and `998796d`; shared memory remains read-only.
## Outcome
- Active-help and guided-help messages now identify the student's entry intent; background checks identify a program-triggered check without a fabricated student question. They no longer mandate a teaching strategy.
- Reply instructions now declare only the two fields, Markdown body support, optional 0–3 nonempty shortcut strings, and delegation of content/style to published configuration.
- Main rejects excess newly generated shortcuts without silently truncating or rewriting them: prose is retained, cards are withheld, and the exact raw answer and format diagnostic are saved. 0/1/3-card replies preserve prefixes and duplicates. The shared compatibility parser and historical store remain unchanged.
- The UI now shows recorded reply-format errors beside the preserved answer; raw content stays collapsed and inert. Existing colors, layout, click handling and drafts are unchanged.
- Regression coverage includes local/cloud service persistence, history read/list/save, all entry intents, current/legacy envelopes, and UI behavior. README reflects the responsibility boundary and current capacity.
- No merge, push, running-app restart, cloud config change, or canonical memory edit performed.
## Verification
- Dependency installation: pinned pnpm 10.33.4, frozen lockfile, offline cache; no tracked dependency change.
- Focused final suite: 269/269 passed across teacher-guidance, teacher-reply, teacher-reply-history, coding-teacher, coding-teacher-cloud, coding-teacher-model and coding-teacher-ui.
- `corepack pnpm run typecheck`: passed.
- ESLint for all changed TypeScript/TSX files, including the Electron E2E spec: passed.
- `corepack pnpm run build:vite`: passed after the final UI change.
- `git diff --check` and task-aware project-doc drift check: passed.
- Independent read-only review found no remaining teaching-policy directives in the scoped runtime files and confirmed lossless historical handling.
- Added a focused Electron E2E case for visible format errors, absent rejected shortcut buttons, collapsed exact raw text, and preserved drafts. Playwright test collection passed using an existing Electron distribution override; the native test was not executed to avoid launching another app window during concurrent work. Component/service assertions covering these behaviors passed.
- Real published-model responses were not tested. Existing topics retain their pinned configuration versions; code tests do not establish that an updated cloud prompt is active.
## Follow-ups
- Integrate this commit after the legacy-component cleanup; merging/pushing belongs to the user's other conversation.
- Validate actual Alice output with a new topic using the published cloud version. Local tests cannot prove model behavior or that existing pinned topics picked up a new prompt.
- Three-operation-round checks and shared confirmed context remain separate work.
## Promotion Candidates
- Target: canonical teacher decision/current-state documents during integration.
- Proposal: runtime help/check-in markers convey entry facts only; teaching strategy is entirely in the selected published agent configuration. Current newly generated replies accept 0–3 shortcuts; historical card counts remain lossless.
- Evidence: context/reply code and focused tests in this task; user's accepted client/agent boundary in this conversation.
- Future impact: future personas can use the same interface without inheriting Alice's teaching policy; prompt changes are evaluated against the actual published topic version.
- Semantic conflicts: supersedes cleanup task's remaining locally mandated single discussion focus and unrestricted new-card count; retains historical compatibility and UI cleanup.
- Human confirmation: not additionally required for these already accepted boundaries; no canonical edits in this feature task.

View File

@@ -0,0 +1,50 @@
# Task: Explain the first-click teacher welcome bubble
## Identity
- Task ID: 20260928-teacher-welcome-diagnosis-4fb809c2
- Mode: Feature
- Branch: codex/20260928-teacher-welcome-diagnosis-4fb809c2-teacher-welcome-diagnosis
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260928-teacher-welcome-diagnosis-4fb809c2
- Base commit: 4495345fb0a9ea1abef8e603629ce9b51d73eb05
- Owner: codex
- Status: Ready for Integration
## Scope
- Diagnose and fix the first-click teacher welcome bubble at baseline 4495345. Entering consultation consumes the static welcome and preserves true unread proactive messages.
## Intent And Constraints
- User first asked why the screenshot bubble appears, then explicitly requested the proposed fix.
- Concurrent and Planning Gates passed in this owned checkout; task identity, branch, absolute path and base verified on resume. Relevant project memory and peer scopes reviewed. Adjacent cleanup and truncation tasks remain isolated.
- Preserve published greeting content inside the consultation panel, account/project scope, real unread check-ins, cloud configuration, model requests and conversation state.
- No main merge, live trial restart, cloud publication or paid model request in this task.
## Outcome
- Cause: welcome_message displayed after config load until explicit dismissal; avatar entry only opened the panel, leaving the welcome bubble visible and changing its CTA to 看看智能体说的.
- The hook now hides static welcome immediately when consultation is open, then records welcome-dismissed for the current account/project. This also handles entering before async config completes, closing before config completes, same-agent selection and reload.
- The effect runs after scope initialization and changes only welcomeDismissed. Real invitations and seen receipts are untouched; a real check-in still requires explicit viewing/dismissal.
- Updated current README and focused unit/Electron coverage. Independent review found no actionable issue.
## Verification
- New unit tests first reproduced three failures on the prior source; unread check-in preservation already passed.
- corepack pnpm 10.33.4: teacher-companion.test.tsx, 33 passed.
- pnpm run typecheck, scoped ESLint, pnpm run build:vite and git diff --check passed.
- Electron welcome test passed: avatar entry, close/reopen, renderer reload, panel greeting retained, no model/topic POST.
- Electron proactive test passed: entry/close does not consume unread message; explicit CTA consumes it, original focus/draft/layout/timer assertions retained. Initial modified test had an invalid remount-focus expectation when opening an already-open panel; restored its original close-then-CTA sequence and reran successfully. Final total: 2 relevant Electron scenarios passed.
- Verification uses the existing mocked Host fixture with isolated test profiles; no real provider or trial application updated.
## Follow-ups
- Integrate this small source change with the current main/trial version through its owning integration task. Build outputs, test profiles and dependency symlink are not committed.
## Promotion Candidates
- Target: canonical classroom interaction/current-state docs during an integration task.
- Proposal: entering consultation consumes and persists the static welcome per account/project; actual unread proactive messages remain until explicitly viewed/dismissed.
- Evidence: explicit user request, hook change, 33 unit tests and two Electron scenarios.
- Future impact: prevents redundant first-entry invitations without hiding real messages.
- Semantic conflicts: supersedes the older welcome-until-manual-dismissal behavior only. No further human confirmation needed for this accepted behavior; canonical promotion remains integration-only.