docs: explain teacher availability message and refresh behavior

This commit is contained in:
2026-09-22 14:16:39 +08:00
parent e5d271bc45
commit 2c2031469e

View File

@@ -0,0 +1,44 @@
# Task: Diagnose coding teacher unavailable message
## Identity
- Task ID: 20260922-teacher-unavailable-6d8fa721
- Mode: Feature
- Branch: codex/20260922-teacher-unavailable-6d8fa721-teacher-unavailable
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260922-teacher-unavailable-6d8fa721
- Base commit: e5d271bc457b4e91e6bda52a28db4a1ecf91d406
- Owner: codex
- Status: Ready for Integration
## Scope
- Explain the screenshot message 老师暂未开放 by tracing its exact UI condition and cloud configuration path. Product code and live Operations state remain read-only.
## Intent And Constraints
- Project Context Loaded: official check/start/status passed with Identity above, feature mode, isolated managed worktree and base e5d271bc457b4e91e6bda52a28db4a1ecf91d406. 123 owner records read; 17 peer placeholder scopes remain unknown, no concrete conflicting dependency. Packaging 1.6.2 is independent and product-read-only.
- Read entry/planning-gate, own record, teacher ADR and integrated state; reuse unchanged memory-index, template positioning, decisions, system/module/data-flow/domain, success criteria and evidence/reflection/commitment/stale context already loaded during preceding integration. Project goal remains Electron/Main-owned coding with independently configured official teacher.
- Active constraints: no subagents, no code/configuration/production writes, no paid calls, no access to credentials or unrelated peer work. Accepted teacher ADR separates publication from enablement; deployment and live billing are not established by merge.
- Planning Gate Passed. Relevant modules: TeacherChatPanel, teacher config client/service and CodingChatPanel mount lifecycle. Current live server enabled status is unknown; screenshot establishes only the last loaded client state.
- diagnosing-bugs applied as bounded symptom-condition inspection. This is a behavior question, not an established defect or requested fix; skip reproduction, hypothesis ranking and regression mutation because the exact single UI condition resolves what the message means. Do not claim a live backend root cause without its response.
## Outcome
- TeacherChatPanel.tsx:65-68 reads config.enabled; :336-337 renders this exact message only when enabled is false (initial value is true). :383 disables sending under the same condition.
- Main definition() forwards /api/coding-teacher/config availability and reads the published definition independently of enabled; restored local topic history may also supply name/avatar. Seeing 编程老师1 does not establish current enablement.
- Production createTopic rejects disabled or unpublished status; each send rechecks live availability. Permission/config request failures produce different errors.
- Panel config load runs on mount/base/draftRevision only, without a focus/poll refresh. CodingChatPanel conditionally mounts the panel; closing and reopening reloads enabled state. Thus enabling in Operations while the panel stays open can leave the displayed status stale.
- Explain Operations must have a published version and enabled switch. If already enabled, close/reopen teacher panel. Did not inspect the user's current live backend response, so unenabled vs stale loaded status remains unverified.
## Verification
- Read-only exact-path searches and source reads at e5d271b establish setter, message predicate, send disabling, status forwarding and remount behavior. No runtime test executed or production state changed.
- Inspected own diff; only this task record is changed. Task-aware documentation drift is checked before completion.
## Follow-ups
- If enabling and reopening does not clear the message, inspect the actual authenticated config response and which server the client connects to. No credentials or server response were acquired in this task.
## Promotion Candidates
- None recorded.