Repository navigation
Conversation
`writeSessionEntry`'s reset path used trivial ternaries of the form `resetTriggered ? existingEntry?.X : existingEntry?.X` for nine fields: `thinkingLevel`, `verboseLevel`, `reasoningLevel`, `ttsAuto`, `modelOverride`, `providerOverride`, `authProfileOverride`, `authProfileOverrideSource`, and `authProfileOverrideCompactionCount`. Both branches were identical, so the session-level value was preserved across `/reset`, which prevented `agentCfg?.thinkingDefault` and the sibling agent-level fallbacks from ever being consulted again once a user had set an explicit value. The neighbouring `responseUsage` field already used the intended `resetTriggered ? undefined : existingEntry?.X` shape, which is now applied to the nine fields above. Adds two regression tests: one asserts the fields are cleared on `/reset`, the other asserts they are preserved on a normal turn so that the non-reset path is not regressed. Refs openclaw#80377 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 11:46 PM ET / 03:46 UTC. Summary PR surface: Source -8. Total -8 across 1 file. Reproducibility: not applicable. This PR no longer claims a user-visible bug fix. Source inspection shows the edited expressions are equivalent for the cleanup scope, while the reset-contract behavior remains tracked separately. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch if maintainers still want the cleanup, preserve current fast-reset Do we have a high-confidence way to reproduce the issue? Not applicable: this PR no longer claims a user-visible bug fix. Source inspection shows the edited expressions are equivalent for the cleanup scope, while the reset-contract behavior remains tracked separately. Is this the best way to solve the issue? Yes for the cleanup scope: direct optional reads are the narrowest maintainable replacement for identical ternary branches. No for the linked behavior request; changing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source -8. Total -8 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
The clawsweeper review on this PR established that production `/reset` semantics live in `initSessionState` (src/auto-reply/reply/session.ts), not in `initFastReplySessionState`. The fast-path is only executed under `OPENCLAW_TEST_FAST=1` and the production runtime intentionally preserves user-set behavior overrides across `/reset` (per openclaw#69301). Revert the behavior change and the regression tests, and instead replace the nine trivial `resetTriggered ? existingEntry?.X : existingEntry?.X` ternaries with the simple `existingEntry?.X` expression. Net effect: no semantic change vs origin/main; the dead `resetTriggered` branches are removed so the code no longer suggests intent that the runtime does not match. Refs openclaw#80377 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Updated the PR body to match the cleanup-only scope after this morning's review:
This should address the "PR body and proof are stale" and "behavior proof" findings. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Heads up: this PR needs to be updated against current |
|
@gllbrn thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
@gllbrn thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
@gllbrn thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing per ClawSweeper review verdict |
Summary
This PR was originally proposed as a fix for #80377, claiming
/resetwas preserving session-level overrides incorrectly. After review byclawsweeperand inspection ofinitSessionState(the actual production reset path), it turns out the runtime behavior is intentional:/resetso users don't re-enable them every time (seesrc/auto-reply/reply/session.ts:510-518)resolveResetPreservedSelection, which preserves user-driven selections and clears only auto-created ones (per Telegram direct session survives /new and /reset with persisted model/provider/auth override #69301)So this PR has been pivoted from a behavior fix to a cleanup-only refactor. The original commit (
1a1685a) and the regression tests it added have been reverted in1d70235. The only remaining net change versusorigin/mainis replacing nine trivialresetTriggered ? existingEntry?.X : existingEntry?.Xternaries ininitFastReplySessionStatewith the simpleexistingEntry?.Xexpression.Net effect: zero semantic change vs
origin/main. The deadresetTriggeredbranches no longer mislead readers into thinking the fast-path bootstrap has reset-specific logic that the runtime doesn't actually have.Issue #80377 should be closed as wontfix / by-design (the bundle pattern that was reported is a copy-paste artifact in this fast-path init, not a production runtime bug). This PR does not fix #80377; it only references it.
Files touched
src/auto-reply/reply/get-reply-fast-path.ts— simplify 9 no-op ternaries (no semantic change)Behavior proof (no-op refactor)
This is a semantic no-op cleanup; the proof is the diff itself. Before/after, every assignment evaluates to the same value:
For both
resetTriggered === trueandresetTriggered === false, both expressions yieldexistingEntry?.thinkingLevel. TheresetTriggeredsemantics still flow through the...(!resetTriggered ? existingEntry : undefined)spread on line 245 (unchanged), so reset still dropsresponseUsageandsessionStartedAtcorrectly. The full pre-existing test suite forget-reply.fast-path.test.ts(12 tests) continues to pass:Test plan
pnpm test src/auto-reply/reply/get-reply.fast-path.test.ts→ 12/12 (pre-existing tests, unchanged)pnpm tsgo:core→ greenpnpm tsgo:core:test→ green (withGOMEMLIMIT=2GiBon a memory-constrained dev box)🤖 Generated with Claude Code