Repository navigation
fix(matrix): show reasoning when explicitly enabled - #149906
zhangguiping-xydt wants to merge 20 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR delivers explicitly enabled completed reasoning as quiet Matrix notices across direct and queued replies. Example: An authorized Matrix user sends
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain This PR addresses a current Matrix bug and has sufficient bounded behavior proof; SDK contract acceptance and unresolved CI failures still block merging. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherCore reply execution produces reasoning payloads; producing-turn visibility, queue custody, and Matrix transport checks determine whether those payloads reach a room. flowchart LR
A[Authorized Matrix input] --> B[Core reply execution]
B --> C[Producing turn visibility]
C --> D[Direct or queued delivery]
D --> E[Matrix final authority check]
E --> F[Quiet reasoning notice]
D --> G[Ordinary answer]
Technical reviewBest possible solution: Accept a narrow host-owned visibility contract that delivers explicit on-mode reasoning through existing queue and Matrix transport owners while preserving ordinary-answer privacy and durability. Do we have a high-confidence way to reproduce the issue? Current-main source shows both missing lane opt-in and unconditional Matrix suppression, corroborated by the linked official-release report; this review ran no reproduction. Is this the best way to solve the issue? The smallest complete fix binds explicit display permission to the producing turn and carries it through existing queue and transport owners, which this patch implements without removing ordinary reasoning sanitization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 35f1c997985e. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +604, Tests +2221, Docs +37, Other +2. Total +2864 across 75 files. Added test files: 4. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (21 earlier review cycles; latest 8 shown)
Reviewed November 3, 2026, 10:08 PM ET / November 4, 2026, 03:08 UTC (Revision 22). |
82e3dc7 to
d05dfbb
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The explicit-opt-in finding is repaired in 7e6a350. The PR body now includes the reproduced parent fallback disclosure, exact-candidate no-preference and global/agent-on controls, refreshed native queued cases, clean teardown, focused checks and independent complete-diff source review. Hosted CI is still pending; SDK contract acceptance remains a maintainer decision. |
|
🦞👀 Re-review progress:
|
Related: #81892
What Problem This Solves
Fixes completed model reasoning being silently suppressed on Matrix after an authorized user enables it, including queued followups, while preventing model-inferred defaults from disclosing reasoning without an explicit preference.
User Impact
Authorized, explicitly enabled reasoning appears as quiet
m.noticemessages with empty mentions. Missing, off or stream preferences do not grant completed-reasoning display. Ordinary answers continue normally. Committed off changes and lost source-turn authority suppress unsent reasoning.The optional SDK visibility reader, reply opt-in and outbound capability still require maintainer acceptance of the public contract. There is no persisted schema, dependency or operator configuration migration. Streaming reasoning is outside this change.
Why This Change Was Made
One producing-turn policy follows direct dispatch, native queue custody and the final Matrix SDK handoff. It accepts explicit inline/session/agent/global choices separately from model execution defaults. Existing session identity, revision, cancellation, revocation and writer checks remain in force. Guarded reasoning stays live-only and outside replayable outbound intents and ordinary confirmed-history callbacks; previews and ordinary answers retain their owners.
The explicit-choice repair fixes the review's explicit-opt-in finding using the existing visibility owner. It changes two production files (+11/-4); the whole PR is the completed explicit-on Matrix feature across direct and queued paths. No second policy owner, persistence manager or test-only production hook is added.
CI repair
Current candidate:
6bd643b07c97c1a18fb2c206dcd7f8ad9142d2d8(parent7e6a350b). The repair changes only the cleanup lifecycle test and a dedicated allocation for its three added test lines; all previous production changes are unchanged.The retry test now closes the shared-state worker before taking over the clock and resets its queued attachment-cleanup mock in
finally. If the timer assertion exits early, the following test no longer inherits an unconsumed blocking mock. Existing assertions and timeouts remain intact. The extra timer's original hosted source was not naturally reproduced; the worker-close ordering follows the same policy fixture already used nearby.The complete modified lifecycle file passed 214 tests on this committed candidate (248.9 seconds wall time including worker compilation; 65.86 seconds Vitest duration). Affected agent/session test types, typed lint, formatter parity and the test-line ratchet passed. The initial instrumented diagnosis passed the three cleanup cases but failed a different requester-agent assertion; that diagnostic is retained, and its passing final replay is not claimed as a causal fix. Original Matrix-focused evidence below is reused only for unchanged source inputs.
The exact committed source CLI build passed using the supported declaration-skip option. A fresh real Gateway / real agent / normal model-fallback / installed Matrix SDK / HTTP run with synthetic external services confirmed global explicit-on produces one quiet reasoning notice and one ordinary answer. Public channel stop, 112 seconds of SDK quiet, and host stdin EOF ended in natural Gateway exit 0 without forced termination. The local homeserver recorded a disconnected long-poll response during channel stop; the behavior and teardown assertions passed. This reruns one positive control; the other unchanged-source controls below retain their original execution identities.
An independent Codex source review inspected the complete final 77-file diff and relevant owners with no actionable findings. Reviewed base
72e8e422, head6bd643b0; canonical diff SHA-256e241483c84445361aef46f250b6c564dec0d1cbfc557a4a22d50968b3e3f4729. This source review does not substitute for hosted CI or maintainer acceptance.The original restart timeout was localized to
resume:2:streamafter SIGKILL, following successful SIGTERM and managed-restart cycles. The fresh hosted merge includes main’s related fixes #192501 and #193730; this repair does not rebase or change restart production code. The restart job executed all five cases successfully, including the previously failingblocked store: falsecase in 70.462 seconds. This establishes a passing current merge, without retroactively attributing the prior-head timeout.Hosted CI run 42334091119 tests merge
6cd775a4f850f4236a6b016787d0bc10655812ed, whose parents are main5cbe1abda85de6db54f01ac99897c2ba00a426b9and candidate6bd643b07c97c1a18fb2c206dcd7f8ad9142d2d8. The cleanup job passed both previously failed cases: stale cleanup retry (9 ms) and detached attachment cleanup recovery (8 ms). The CI workflow completed successfully: 70 jobs passed, 27 skipped, zero failures. All nine current-headpull_requestworkflows completed successfully, including Darwin tooling, CodeQL, critical quality and runtime conformance. The original failed PR-context check was corrected by restoring the required## Evidenceheading and superseded by successful same-head run 42334161235. Maintainer SDK acceptance remains separate.Evidence
The feature proof below retains its original execution identity; the current-commit CI repair and fresh positive control are recorded above.
Exact candidate:
7e6a350b4b787cc6ea0d6e0cfafffee34d718747, reviewed against72e8e42210d1bf5f69d0384c84baec0188743337.Explicit-choice regression, through the actual built Gateway, agent, model fallback, installed Matrix SDK and final HTTP: a fresh session has no inline or persisted reasoning/thinking preference. The primary MiniMax M2.7 request returns model-not-found over HTTP; normal fallback executes M3.1 Flash with its supported thinking level. The external model and homeserver are synthetic fixtures.
5ee9ba03reasoning / answer HTTP7e6a350breasoning / answer HTTPreasoningDefault: "on"reasoningDefault: "on"The direct M2.7/off route alone did not reproduce disclosure because another producer guard suppressed reasoning. The fallback route above does reproduce it; no provider resolver, execution default or fallback behavior was changed to manufacture the result.
Queued behavior rerun on the same candidate: public Matrix
/statusobserved depth 0→1 behind a held model request before each queued turn began.The off change committed before release and before the queued model request. Returned ordinary source-history text excludes reasoning markers; native structured thinking remains in the model transcript.
All four executions (three configuration controls and one three-scenario queue run) used public
channels.stop, a verified stopped Matrix runtime and at least 112 seconds of HTTP quiet to retire existing SDK deadlines. Documented host stdin EOF then produced natural Gateway exit 0 and a clean receipt, without forced termination, warnings, residual owned descendants or unjoined fixture threads. This qualifies staged teardown; direct whole-Gateway cancellation of referenced SDK timeout handles remains unqualified.Focused checks and review:
267fbbe15caed1b272a8c8f9034449bc9a33837ecf14303d91c79e09fa5ba6f4.Remaining boundaries: the original broad queue driver still reports
PARTIAL_PROOF/ exit 2 for supplementary cross-destination history; a separate qualifier preserves that result and qualifies only the three retained-queue-to-HTTP scenarios and clean teardown. Ordinary source-history exclusion does not establish positive durable answer persistence in a different destination. These fixtures do not qualify a live tenant, E2EE or a real inference service. Maintainer SDK acceptance, hosted CI and review labels remain separate.Hosted review inspected at closeout: ClawSweeper revision 22, reviewed at 2026-11-04 03:08 UTC on
7e6a350b, reports no actionable code or security findings, sufficient bounded behavior proof (5/6), and complete fix scope. It remains blocked before merge on public SDK acceptance and unresolved CI attribution. The earlier waiting-on-maintainer label was removed; there is no ready-for-maintainer-look label. Acceptance of the public visibility reader, reply opt-in and outbound capability remains an explicit maintainer decision. No merge approval is claimed.CI run 41762256595 completed on merge
95093b3binto main73591122: 69 jobs succeeded, 27 were skipped, and 3 failed. Two are test-job failures; the third is their aggregateopenclaw/ci-gate. Production types and baseline ratchets passed.blocked store: falsetimed out at 180 seconds. Captured output includes store-target collisions, pending startup admission and a skipped restart resume; the other three hosted cases passed.The affected test files are byte-identical at the CI main base, merge and PR head, and the cleanup implementation is unchanged base-to-merge. The pipeline failure report classifies both jobs unknown, with no matching scheduled-main job. Earlier-head MCP/type and test-budget diagnoses do not apply to this run.
Bounded baseline diagnosis: an independent snapshot of exact main
73591122was verified against its complete Git treefad0f1f5e57b41e296f45b8aabf6e60b444bdb2d; package/lock/workspace/Bun-pin inputs match. Tests ran serially under the same pinned Bun in a secretless, network-isolated container.All 63,635 tracked baseline blobs still matched after the diagnostic and its container was stopped. These baseline results do not certify the PR candidate. That prior-head CI remained failed and attribution unresolved. No failed check was suppressed or represented as passing, and no empty commit or blind CI rerun was used. Public SDK acceptance remains a separate maintainer decision.