Codex follow-up review on #70898: the `startIdx < kept.length - 1`
guard still wrote an assistant-first transcript when every turn inside
the retained window was an assistant (e.g. a tail of consecutive
assistant messages). That re-creates the exact role-ordering hazard the
reset path is recovering from.
Advance through the full window and, if no user turn remains, return 0
without touching the target transcript. Missing a few turns of DM
continuity is strictly better than re-triggering the conflict.
Locked in with a new assertion on the existing unit test.
Made-with: Cursor
Addresses AI code review findings on #70898:
- P1 (Codex): replayed tail can start with an assistant message when the
source has an odd number of retained turns; in the role-ordering reset
path, the next run would immediately reproduce the same conflict.
Align tail start to a user turn.
- P2 (Greptile): readFileSync blocks the event loop on long DM
transcripts. Switch helper to fs.promises async I/O and await in the
sole caller.
- P2 (Greptile): mode on appendFileSync is a no-op for pre-existing
files. Drop the misleading option; header write already enforces 0o600.
- P2 (Greptile): add coverage for pre-existing target + tail alignment
branch.
Made-with: Cursor
Silent in-reply session rotations (compaction failure, role-ordering
conflict) mint a fresh sessionId and an empty transcript, so
direct-chat continuity is lost between the previous turn and the
rebound one. Carry the tail of user/assistant JSONL records from the
prior transcript into the freshly-rotated file so the next model turn
still sees recent context. Tool, system, and compaction records are
deliberately excluded to avoid reshaping tool/role ordering.
Fixes#70853.
Made-with: Cursor
Fixes#73502.
Active Memory now allows its hidden recall sub-agent to use both bundled memory tool contracts: memory_recall for memory-lancedb and memory_search/memory_get for memory-core. The prompt prefers memory_recall when available and falls back to the legacy tool pair when that is the active backend surface.
Also updates Active Memory docs, QA mock fixtures, and debug parsing compatibility for the two recall paths.
Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test (local full suite failed in unrelated plugin/logging shards; PR-specific docs/changelog checks and GitHub checks passed)
- GitHub status checks for c2c5a94df8 completed without failure
Co-authored-by: WuKongAI-CMU <210765158+WuKongAI-CMU@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
* fix: Discord read/search timeout, session-key fallback, and gateway execution mode
- Add 15s timeout to readMessagesDiscord and searchMessagesDiscord so they
fail fast instead of hanging indefinitely (#73431)
- Fall back to CommandTargetSessionKey in dispatchReplyFromConfig when
SessionKey is empty, so Discord inbound message:received hooks fire
reliably (#73431, refs #33038)
- Add resolveExecutionMode to Discord channel actions routing read/search
through gateway timeout path, matching Telegram's pattern (#73431)
* fix: move timeout to fetch layer, drop send.messages wrapper
Inject AbortSignal.timeout into the Discord proxy-request-client fetch
wrapper so every Discord REST call gets a 15s timeout at the HTTP level.
This replaces the Promise.race wrapper in send.messages.ts — cleaner,
covers all calls, and actually aborts the TCP connection.
* fix: remove unused callerController variable in proxy-request-client test
* fix: remove unnecessary mergeAbortSignal helper
- docs/plugins/hooks.md: add `cron_changed` to the Lifecycle hook catalog and
a Gateway lifecycle paragraph describing its typed event payload, run
status, delivery status, and removed-event job snapshot, so plugin authors
picking up f155a5f955 (#72773) have a canonical reference beyond the
sdk-overview bullet that already shipped in the same SHA.
- docs/help/environment.md: add a "Legacy environment variables" section for
aa1834a3ff so users see that `CLAWDBOT_*` and `MOLTBOT_*` prefixes are now
ignored and trigger an `OPENCLAW_LEGACY_ENV_VARS` deprecation warning,
with a rename example to `OPENCLAW_*`.
For 058b57867e: docs/providers/qwen.md "Qwen 3.6 Plus availability"
accordion now records that the bundled catalog still does not advertise
`qwen3.6-plus` on Coding Plan endpoints, but explicitly configured
`models.providers.qwen.models` entries for that model are honored on
Coding Plan baseUrls so subscribers whose plan enables it can opt in. The
upstream API still decides whether the call succeeds.