Skip to content

feat(cron): support Google Chat platform for scheduled messages#1374

Open
shaun-agent wants to merge 1 commit into
mainfrom
feat/googlechat-cron-dispatch
Open

feat(cron): support Google Chat platform for scheduled messages#1374
shaun-agent wants to merge 1 commit into
mainfrom
feat/googlechat-cron-dispatch

Conversation

@shaun-agent

@shaun-agent shaun-agent commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What problem does this solve?

OpenAB's Google Chat adapter already supports inbound messages and outbound replies through UnifiedGatewayAdapter, but native cron rejects platform = "googlechat" and does not register the adapter with the scheduler.

This affects both the latest published beta and current main.

Related to #866. This implements only the Google Chat scheduled-message portion and does not close the broader DM and gateway-target proposal.

This is the core transport prerequisite for cron-driven workflows such as Google Sheets reporting. Sheet reads/writes, meeting retrieval, deduplication, alert evaluation, private space IDs, schedules, and credentials remain agent/deployment configuration and are not added to OpenAB core.

Discord Discussion URL: N/A - maintainer-authored follow-up to #866 and merged PR #1315.

At a Glance

config.toml / cronjob.toml
  platform = "googlechat"
  channel  = "spaces/..."
              |
              v
      validate_cronjobs()
              |
              v
        cron scheduler
              |
              v
    UnifiedGatewayAdapter
              |
              v
     Google Chat adapter
              |
              v
      configured Chat space

No thread_id        -> stay at the top level
Explicit thread_id  -> post into that existing thread

Prior Art & Industry Research

OpenClaw:

OpenClaw scheduled tasks separates scheduling from delivery and stores an explicit platform and destination using delivery.channel and delivery.to. It also treats scheduled delivery as an operator automation path rather than an inbound user event.

Hermes Agent:

Hermes scheduled tasks automatically delivers an agent's final response to a configured platform target. Its continuation behavior is platform-specific: thread-capable targets may create threads, while flat surfaces remain top-level.

Other references:

Proposed Solution

  1. Add googlechat to the scheduler's valid platforms.
  2. Treat Google Chat as configured when the feature is compiled and GOOGLE_CHAT_ENABLED is true or 1.
  3. Register the existing unified adapter under the googlechat cron key.
  4. Keep jobs without thread_id at the top level of the configured space.
  5. Preserve explicit Google Chat thread resource names when supplied.
  6. Add validation and thread-selection unit tests.
  7. Update the cron documentation and Google Chat capability schema.

Thread behavior

Google Chat currently ignores OpenAB's create_topic gateway command. Calling the generic unified create_thread implementation would therefore create no remote thread but return a synthetic local thread ID, which could then be used or persisted as though it were a real Google Chat resource.

This change avoids that invalid state. Automatic thread creation remains unchanged for Discord, Slack, and Telegram.

Trust behavior

Cron dispatch intentionally does not pass through the inbound Google Chat trust gate because no external user event initiates the run. The authority comes from trusted baseline cron configuration or an enabled writable usercron file.

Consequently, [googlechat].allowed_users controls inbound messages but does not restrict scheduled outbound delivery. Anyone authorized to modify cron configuration can select a space where the Chat app already has permission to post. This PR does not introduce a separate outbound target allowlist.

Why this approach?

It follows the narrow registration pattern already merged for Telegram in #1315 and reuses Google Chat's existing outbound adapter instead of adding a second delivery implementation.

The Google Chat-specific thread decision is necessary because the platform adapter does not implement create_topic. Remaining top-level is safer than manufacturing and persisting a nonexistent thread ID.

Known limitations:

  • Cron cannot automatically create a new Google Chat thread.
  • Posting to an existing thread requires an explicit full thread resource name.
  • Delivery acknowledgement and retry behavior remain those of the existing unified adapter.
  • Outbound destination authorization remains an operational configuration responsibility.
  • Google Sheets and meeting workflow logic remain outside OpenAB core.

Alternatives Considered

  • External scheduler or webhook: Functional, but duplicates native scheduling and adapter routing.
  • Implement all gateway and DM targets from feat(cron): support DM and gateway platform targets for scheduled messages #866: Broader than the Google Chat requirement and harder to review independently.
  • Implement Google Chat thread creation: Requires separate adapter/API semantics and is unnecessary for basic scheduled delivery.
  • Put Google Sheets or meeting-alert logic in cron core: Rejected because those are workflow-specific agent tools and policies, not transport behavior.

Validation

  • cargo build --features googlechat
  • cargo check --workspace
  • cargo test -p openab-core cron::tests - 74 passed
  • cargo test --workspace - 15 OpenAB, 667 core, and 254 gateway tests passed
  • cargo test --workspace --features unified - 15 OpenAB, 667 core, and 254 gateway tests passed
  • Platform schema tests - 4 unit and 8 conformance tests passed
  • git diff --check
  • Required GitHub CI - workspace check, default/unified Clippy, and workspace tests passed
  • Default and unified Clippy pass when allowing the existing baseline lint:
    • cargo clippy --workspace -- -D warnings -A clippy::collapsible_else_if
    • cargo clippy --workspace --features unified -- -D warnings -A clippy::collapsible_else_if

Local Rust 1.92 additionally reports a pre-existing clippy::collapsible_else_if finding at crates/openab-core/src/pre_seed.rs:471; the repository's required GitHub Clippy jobs pass unchanged.

Manual integration testing used an every-minute usercron job against a private test Google Chat space. The equivalent scheduled delivery path and agent response were observed through the unified adapter. Private target IDs, credentials, meeting content, and Google Sheets data are intentionally excluded from this PR.

The deployed test build also contained deployment-specific workflow extensions; those are not part of this change.

@shaun-agent shaun-agent requested a review from thepagent as a code owner July 12, 2026 15:18
@chaodu-agent

This comment has been minimized.

@chaodu-agent

This comment has been minimized.

@chaodu-agent

This comment was marked as outdated.

@chaodu-agent

chaodu-agent commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants