Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openclaw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Requests use bearer auth and JSON bodies containing the OpenClaw hook context. S

OpenClaw calls `reply_payload_sending` before final payload delivery. The adapter calls the service verdict endpoint and attaches `verdict.media` to the payload. OpenClaw owns the final text send and payload delivery mechanics; the Hent-ai service owns media selection, policy, profile/channel lookup, and verdict state.

Ordinary Hent-ai emotion assets are returned with `sensitiveMedia: false` so durable final delivery can attach them. Assets explicitly classified as sensitive must retain `sensitiveMedia: true`; compatible OpenClaw hosts reject those attachments while preserving the reply text.

Expected service response:

```json
Expand Down
2 changes: 1 addition & 1 deletion service/src/final-response-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("final-response route adapter", () => {
filename: "neutral.png",
contentType: "image/png",
url: "/static/sets/legacy/neutral.png",
sensitiveMedia: true,
sensitiveMedia: false,
metadata: { storageKey: "sets/legacy/neutral.png" },
},
},
Expand Down
2 changes: 1 addition & 1 deletion service/src/final-response-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function mediaResponseForChannel(db: ServiceDatabase, channelId: string |
filename: asset.filename,
contentType: asset.contentType,
url: asset.objectUrl,
sensitiveMedia: true,
sensitiveMedia: false,
metadata: { storageKey: asset.storageKey },
},
};
Expand Down
2 changes: 1 addition & 1 deletion service/src/final-response-use-case.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe("final-response application use case", () => {
filename: "semantic-neutral.png",
contentType: "image/png",
url: "/static/sets/set/semantic-neutral.png",
sensitiveMedia: true,
sensitiveMedia: false,
metadata: { storageKey: "sets/set/semantic-neutral.png" },
},
},
Expand Down
6 changes: 3 additions & 3 deletions service/src/final-response-use-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { SemanticAssetMedia, SemanticAssetRouter } from "./semantic-assets/
import type { FinalResponseVerifier, VerifierJudgment } from "./verifier.js";

export const FINAL_VERDICT_SCHEMA_VERSION = "FinalEmotionVerdictV1";
export const SERVICE_MEDIA_RESPONSE_SCHEMA_VERSION = "ServiceMediaResponseV1";
export const SERVICE_MEDIA_RESPONSE_SCHEMA_VERSION = "ServiceMediaResponseV2-ExplicitSensitivity";
export const VERIFIER_CACHE_POLICY_VERSION = "VerifierCachePolicyV4-NormalizedAffect";
export const ASSET_POLICY_VERSION = "ServiceAssetPolicyV2-AffectSpaceV2";

Expand All @@ -17,7 +17,7 @@ export type ServiceMedia = {
filename: string;
contentType: string;
url: string;
sensitiveMedia: true;
sensitiveMedia: boolean;
metadata: { storageKey: string };
};

Expand Down Expand Up @@ -130,7 +130,7 @@ function serviceMediaFrom(media: SemanticAssetMedia): ServiceMedia {
filename: media.filename,
contentType: media.contentType,
url: media.objectUrl,
sensitiveMedia: true,
sensitiveMedia: false,
metadata: { storageKey: media.storageKey },
};
}
Expand Down
2 changes: 1 addition & 1 deletion service/src/verifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("final-response verifier boundary", () => {

await withServer(db, verifier, async (baseUrl) => {
expect(FINAL_VERDICT_SCHEMA_VERSION).toBe("FinalEmotionVerdictV1");
expect(SERVICE_MEDIA_RESPONSE_SCHEMA_VERSION).toBe("ServiceMediaResponseV1");
expect(SERVICE_MEDIA_RESPONSE_SCHEMA_VERSION).toBe("ServiceMediaResponseV2-ExplicitSensitivity");
expect(VERIFIER_CACHE_POLICY_VERSION).toBe("VerifierCachePolicyV4-NormalizedAffect");
expect(ASSET_POLICY_VERSION).toBe("ServiceAssetPolicyV2-AffectSpaceV2");
expect(finalResponseFixture.versions).toEqual({
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/final-response-v1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": {
"finalVerdict": "FinalEmotionVerdictV1",
"mediaResponse": "ServiceMediaResponseV1",
"mediaResponse": "ServiceMediaResponseV2-ExplicitSensitivity",
"verifierCachePolicy": "VerifierCachePolicyV4-NormalizedAffect",
"assetPolicy": "ServiceAssetPolicyV2-AffectSpaceV2"
},
Expand All @@ -14,7 +14,7 @@
"filename": "neutral.png",
"contentType": "image/png",
"url": "/static/sets/set/neutral.png",
"sensitiveMedia": true,
"sensitiveMedia": false,
"metadata": {
"storageKey": "sets/set/neutral.png"
}
Expand Down
Loading