mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 07:47:15 +00:00
fix(googlechat): preserve typing indicator default
This commit is contained in:
parent
56ade5283e
commit
5923f2af46
4 changed files with 14 additions and 9 deletions
|
|
@ -201,7 +201,7 @@ Use these identifiers for delivery and allowlists:
|
|||
},
|
||||
},
|
||||
actions: { reactions: true },
|
||||
typingIndicator: "none",
|
||||
typingIndicator: "message",
|
||||
mediaMaxMb: 20,
|
||||
},
|
||||
},
|
||||
|
|
@ -217,7 +217,7 @@ Notes:
|
|||
- Reactions are available via the `reactions` tool and `channels action` when `actions.reactions` is enabled.
|
||||
- Native approval cards use Google Chat `cardsV2` button clicks, not reaction events. Approvers come from `dm.allowFrom` or `defaultTo` and must be stable numeric `users/<id>` values.
|
||||
- Message actions expose `send` for text and `upload-file` for explicit attachment sends. `upload-file` accepts `media` / `filePath` / `path` plus optional `message`, `filename`, and thread targeting.
|
||||
- `typingIndicator` supports `none` (default), `message`, and `reaction` (reaction requires user OAuth).
|
||||
- `typingIndicator` supports `message` (default), `none`, and `reaction` (reaction requires user OAuth).
|
||||
- Attachments are downloaded through the Chat API and stored in the media pipeline (size capped by `mediaMaxMb`).
|
||||
- Bot-authored Google Chat messages are ignored by default. If you intentionally set `allowBots: true`, accepted bot-authored messages use shared [bot loop protection](/channels/bot-loop-protection). Configure `channels.defaults.botLoopProtection`, then override with `channels.googlechat.botLoopProtection` or `channels.googlechat.groups.<space>.botLoopProtection` when one space needs a different budget.
|
||||
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ WhatsApp runs through the gateway's web channel (Baileys Web). It starts automat
|
|||
"spaces/AAAA": { allow: true, requireMention: true },
|
||||
},
|
||||
actions: { reactions: true },
|
||||
typingIndicator: "none",
|
||||
typingIndicator: "message",
|
||||
mediaMaxMb: 20,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ describe("googlechat monitor bot loop protection", () => {
|
|||
});
|
||||
|
||||
describe("googlechat monitor direct messages", () => {
|
||||
it("does not create typing messages by default", async () => {
|
||||
it("creates typing messages by default", async () => {
|
||||
const runTurn = vi.fn();
|
||||
const buildContext = vi.fn((payload: unknown) => payload);
|
||||
const core = {
|
||||
|
|
@ -220,7 +220,12 @@ describe("googlechat monitor direct messages", () => {
|
|||
mediaMaxMb: 10,
|
||||
});
|
||||
|
||||
expect(apiMocks.sendGoogleChatMessage).not.toHaveBeenCalled();
|
||||
expect(apiMocks.sendGoogleChatMessage).toHaveBeenCalledWith({
|
||||
account,
|
||||
space: "spaces/DM",
|
||||
text: "_OpenClaw is typing..._",
|
||||
thread: undefined,
|
||||
});
|
||||
expect(runTurn).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -345,13 +345,13 @@ async function processMessageWithPipeline(params: {
|
|||
|
||||
// Typing indicator setup
|
||||
// Note: Reaction mode requires user OAuth, not available with service account auth.
|
||||
// If reaction is configured, we fall back to no indicator with a warning.
|
||||
let typingIndicator = account.config.typingIndicator ?? "none";
|
||||
// If reaction is configured, we fall back to message mode with a warning.
|
||||
let typingIndicator = account.config.typingIndicator ?? "message";
|
||||
if (typingIndicator === "reaction") {
|
||||
runtime.error?.(
|
||||
`[${account.accountId}] typingIndicator="reaction" requires user OAuth (not supported with service account). Falling back to "none".`,
|
||||
`[${account.accountId}] typingIndicator="reaction" requires user OAuth (not supported with service account). Falling back to "message" mode.`,
|
||||
);
|
||||
typingIndicator = "none";
|
||||
typingIndicator = "message";
|
||||
}
|
||||
let typingMessageName: string | undefined;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue