Repository navigation
fix(gateway): fire session:patch hooks for model changes - #82257
giodl73-repo merged 2 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. at source level: register a Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this PR or an equivalent helper after maintainer review and real behavior proof, preserving existing Do we have a high-confidence way to reproduce the issue? Yes, at source level: register a Is this the best way to solve the issue? Yes, the code approach is the narrow maintainable fix: centralize the existing What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against efabae2f9bf0. |
OpenClaw QA ArtifactsSummarySession model hook proof for PR #82257.
Evidence
|
Co-authored-by: Copilot <[email protected]>
) * Fire session patch hooks for model changes Co-authored-by: Copilot <[email protected]> * chore: refresh CI after main repairs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
) * Fire session patch hooks for model changes Co-authored-by: Copilot <[email protected]> * chore: refresh CI after main repairs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
) * Fire session patch hooks for model changes Co-authored-by: Copilot <[email protected]> * chore: refresh CI after main repairs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
) * Fire session patch hooks for model changes Co-authored-by: Copilot <[email protected]> * chore: refresh CI after main repairs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>

Summary
/modeldirective-only updates through the existingsession:patchhook eventsession_status({ model })persist a changed model overridesessions.patchon the same shared hook dispatch helper and add focused regressions for/modelandsession_statusFixes #62751.
Tests
CI=1 node scripts/run-vitest.mjs src/gateway/server.sessions.permissions-hooks.test.ts src/gateway/sessions-patch.test.ts src/auto-reply/reply/directive-handling.model.test.ts src/agents/openclaw-tools.session-status.test.tspnpm exec oxfmt --check --threads=1 src/gateway/server-methods/sessions.ts src/gateway/sessions-patch.ts src/gateway/session-patch-hooks.ts src/auto-reply/reply/directive-handling.impl.ts src/auto-reply/reply/directive-handling.persist.ts src/agents/tools/session-status-tool.ts src/gateway/server.sessions.permissions-hooks.test.ts src/gateway/sessions-patch.test.ts src/auto-reply/reply/directive-handling.model.test.ts src/agents/openclaw-tools.session-status.test.tspnpm check:changedReal behavior proof
Behavior or issue addressed:
session:patchhook events did not fire when a session model changed through/modelor thesession_statustool.Real environment tested: local OpenClaw checkout on Ubuntu 24.04 under WSL, with the real hook registry and session persistence code paths exercised by the focused Vitest shards.
Exact steps or command run after this patch:
CI=1 node scripts/run-vitest.mjs src/gateway/server.sessions.permissions-hooks.test.ts src/gateway/sessions-patch.test.ts src/auto-reply/reply/directive-handling.model.test.ts src/agents/openclaw-tools.session-status.test.ts.Evidence after fix: before/after proof bundle published via Crabbox artifacts:
Observed result after fix:
origin/mainplus only the new regression specs fails because no hook event is observed; this PR branch passes the same focused shard and observessession:patchevents withpatch.modeland the updated session entry.What was not tested: live Discord/Telegram gateway delivery with a deployed workspace hook; this PR validates the source-level hook dispatch path used by those surfaces.