cron: infer payload kind for model-only update patches (openclaw#15664) thanks @rodrigouroz

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check (fails on current origin/main in src/memory/embedding-manager.test-harness.ts; unchanged by this PR)

Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Rodrigo Uroz
2026-02-15 12:12:51 -03:00
committed by GitHub
parent 3c97ec70d1
commit 89dccc79a7
6 changed files with 135 additions and 4 deletions

View File

@@ -181,6 +181,28 @@ describe("gateway server cron", () => {
expect(merged?.delivery?.channel).toBe("telegram");
expect(merged?.delivery?.to).toBe("19098680");
const modelOnlyPatchRes = await rpcReq(ws, "cron.update", {
id: mergeJobId,
patch: {
payload: {
model: "anthropic/claude-sonnet-4-5",
},
},
});
expect(modelOnlyPatchRes.ok).toBe(true);
const modelOnlyPatched = modelOnlyPatchRes.payload as
| {
payload?: {
kind?: unknown;
message?: unknown;
model?: unknown;
};
}
| undefined;
expect(modelOnlyPatched?.payload?.kind).toBe("agentTurn");
expect(modelOnlyPatched?.payload?.message).toBe("hello");
expect(modelOnlyPatched?.payload?.model).toBe("anthropic/claude-sonnet-4-5");
const legacyDeliveryPatchRes = await rpcReq(ws, "cron.update", {
id: mergeJobId,
patch: {