fix(coding): restore sending after queued messages settle

This commit is contained in:
2026-09-12 12:50:01 +08:00
parent 2cedc9df30
commit 954b275f10
6 changed files with 162 additions and 8 deletions

View File

@@ -0,0 +1,50 @@
# Task: Diagnose unavailable model and stuck queued chat message
## Identity
- Task ID: 20260912-chat-send-diagnosis-b6580605
- Mode: Feature
- Branch: codex/20260912-chat-send-diagnosis-b6580605-chat-send-diagnosis
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260912-chat-send-diagnosis-b6580605
- Base commit: 2cedc9df300ae0fb4592d078c948cc1f37b8c305
- Owner: codex
- Status: Ready for Integration
## Scope
- Diagnose the reported disabled Code send button and lingering accepted-message notice after a queued message. Compare current main and the installed Windows 1.4.3 Renderer with the behavior described in the user's previous repair screenshot.
- Fix only effective Composer prompt mode and successful queued-request bookkeeping; add focused component/store regressions and extend the existing Electron feature flow.
## Intent And Constraints
- Concurrent Task Gate and Planning Gate passed. This worktree is exclusively owned; current main and all 180 retained peer worktrees stay read-only. Historical placeholder peer scopes remain unknown coordination state, with no identified semantic dependency on this bounded repair.
- Apply maintain-project-docs and diagnosing-bugs; the user prohibits subagents, so work is serial. Keep Main-owned Pi 0.84.2, authoritative Snapshot/Patch queue state, project isolation, accepted/uncertain non-replay, credentials and user data unchanged.
- Initial title used an unverified model-unavailable interpretation. Source and installed Renderer inspection corrected it: the screenshot says 不可调, which describes thinking-level options and does not gate canSend.
- README already documents supported same-Conversation queueing and the 不可调 label. This fix restores that behavior without changing product architecture or its documented contract.
## Outcome
- Reproduced the exact disabled-send state with follow-up/steer followed by completed/aborted idle snapshots. The saved mode remained non-prompt while the idle Composer required prompt; its mode selector was hidden, leaving no way to change it in the idle UI.
- Independently reproduced accepted follow-up/steer records surviving a terminal Snapshot followed by a late successful acknowledgement. These requests have no optimistic message node, while request reconciliation waits for clientRequestId-bearing messages; Pi queue projection may assign its own identity.
- Effective prompt mode now follows the current authoritative run state: idle sends use prompt. Successful follow-up/steer acknowledgements remove only their local request records; the authoritative queue remains intact. Prompt optimistic-node reconciliation and uncertain requests retain existing behavior.
- Read-only installed-artifact evidence: executable D:/Tools/泥土/niancode/Makelore/Makelore.exe reports 1.4.3.0. Its resources/app.asar contains dist/assets/index-Br3sYwTv.js with the old running-vs-stored-mode canSend condition and the accepted-count banner. Current main at the recorded base has the same defects. The repair described in the supplied screenshot is absent from these inspected versions; the location or disposition of that earlier patch is unverified.
- No main merge, installed-client replacement, package build, external Provider call, push, deployment or user-message replay was performed. The fix is a local source handoff and must not be described as installed or released.
## Verification
- Pinned pnpm 10.33.4; pnpm install --frozen-lockfile passed.
- Red-capable loop: pnpm exec vitest run tests/unit/coding-chat-panel.test.tsx tests/unit/coding-conversations-store.test.tsx -t 'sends again after|acceptance even when settlement' --reporter=dot. Before production edits: 6 failed (4 disabled-button assertions, 2 residual accepted-request assertions); after fix: 6 passed.
- Full affected component/store files: 57 tests passed. Existing rejection recovery, attachment handling, optimistic identity, reconnect and uncertainty coverage passed together with the new regressions.
- pnpm run typecheck passed. Scoped ESLint for all five changed source/test files passed.
- pnpm run build:vite passed for Renderer, Main, Preload and utility targets; existing chunk-size/dynamic-import/Browserslist warnings remain.
- pnpm exec playwright test tests/e2e/pi-coding-first-chat.spec.ts --grep 'PI feature UI' --reporter=list passed (1/1). The Electron flow now actually posts follow-up, checks that the queue stays visible without a residual accepted notice, aborts, then submits 继续 via Enter as prompt.
- Full-repository unit suite and real Provider execution were not run; validation targets the changed Renderer/store behavior and existing Electron fixture.
- Task documentation drift and final whitespace checks are recorded at handoff.
## Follow-ups
- Integrate this committed source fix and include it in a verified replacement installer before claiming the user's installed application is fixed. Preserve the current live session; no automatic retries or reset of user data are needed.
## Promotion Candidates
- None. This repair restores the existing Code queue contract and does not change canonical architecture or product decisions. Source-test success and installed-artifact delivery must remain distinct in the final handoff.