openclaw - 💡(How to fix) Fix Cron delivery to Slack uses main agent identity instead of job's agentId identity [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#49313Fetched 2026-04-08 00:56:38
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×2

Fix Action

Fix / Workaround

Workaround Needed

Is there a config flag to ensure cron delivery passes the job's agentId through to the Slack send path?

RAW_BUFFERClick to expand / collapse

Bug

When a cron job runs for a sub-agent (e.g., agentId: nova), the delivery to Slack uses the main agent's identity (Titan) instead of the job's agent identity (Richard/Nova).

Expected Behavior

Cron job delivery should use resolveAgentOutboundIdentity(cfg, job.agentId) to resolve the correct username and icon_url for Slack chat.postMessage.

Actual Behavior

All cron deliveries show as the main agent (Titan) regardless of which agent the job belongs to.

Evidence

  • Direct message tool calls from agents → correct identity ✅
  • Direct Slack API with username/icon_url → correct identity ✅
  • Identity test message (manual) at 7:17 PM → shows as Richard
  • Cron-triggered report at 8:04 PM (same agent, same channel) → shows as Titan

Config

  • chat:write.customize scope is present
  • Agent identities configured with name and avatar (https URLs)
  • All agents have correct identity config
  • OpenClaw version: 2026.3.13

Workaround Needed

Is there a config flag to ensure cron delivery passes the job's agentId through to the Slack send path?

extent analysis

Fix Plan

To resolve the issue, we need to modify the cron job delivery to use the correct agent identity. We can achieve this by passing the agentId to the resolveAgentOutboundIdentity function.

Step-by-Step Solution

  • Update the cron job delivery code to include the agentId in the Slack message payload:
const agentId = job.agentId;
const { username, icon_url } = resolveAgentOutboundIdentity(cfg, agentId);
const messagePayload = {
  // ... other payload properties ...
  username,
  icon_url,
};
  • Ensure that the resolveAgentOutboundIdentity function is correctly configured to return the agent's username and icon_url based on the provided agentId.

Example Code

// Assuming a function to send a Slack message
async function sendSlackMessage(job, message) {
  const agentId = job.agentId;
  const { username, icon_url } = resolveAgentOutboundIdentity(cfg, agentId);
  const payload = {
    channel: message.channel,
    text: message.text,
    username,
    icon_url,
  };
  // Send the message using the Slack API
  await slack.chat.postMessage(payload);
}

Verification

To verify that the fix worked, trigger a cron job for a sub-agent and check that the delivered message shows the correct agent identity (e.g., Richard/Nova) instead of the main agent (Titan).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Cron delivery to Slack uses main agent identity instead of job's agentId identity [2 comments, 3 participants]