Golem fire and forget moonbit

From golemcloud/golem · View interactive version

Golem fire and forget moonbit is an AI agent skill from the GitHub repository golemcloud/golem. Triggering a MoonBit Golem agent invocation without waiting for the result. Use when the user asks to fire-and-forget, trigger asynchronously, or enqueue an agent call from within agent code.

How to use this skill

Skill file

Fire-and-Forget Agent Invocation (MoonBit)

Overview

A fire-and-forget call enqueues a method invocation on the target agent and returns immediately without waiting for the result. The target agent processes the invocation asynchronously. This is for agent-to-agent calls from code, not from the CLI.

For CLI fire-and-forget, see the golem-trigger-agent-moonbit skill.

Usage

Methods with recursively stream-free inputs and outputs have an auto-generated trigger_ variant. Run these fragments inside an async function: AgentClient::scoped_upsert and its callback are async, while the trigger_ enqueue itself is synchronous. Propagate async to helpers and callers:

AgentClient::scoped_upsert("my-counter", async fn(client) {
  client.trigger_increment()
})

With arguments:

DataProcessorClient::scoped_upsert("pipeline-1", async fn(client) {
  client.trigger_process_batch(batch_data)
})

When to Use

Example: Breaking a Deadlock

// In AgentA — calls AgentB and waits
AgentBClient::scoped_upsert("b1", async fn(client) {
  let result = client.do_work(data) // OK: awaited call
  // ...
})

// In AgentB — notifies AgentA without waiting (would deadlock if awaited)
AgentAClient::scoped_upsert("a1", async fn(client) {
  client.trigger_on_work_done(result) // OK: fire-and-forget
})

Example: Fan-Out

let regions : Array[String] = ["us-east", "us-west", "eu-central"]
for region in regions {
  RegionProcessorClient::scoped_upsert(region, async fn(client) {
    client.trigger_run_report(report_id)
  })
}

CLI Equivalent

From the command line, use --trigger:

golem agent invoke --trigger 'CounterAgent("my-counter")' increment

See the golem-trigger-agent-moonbit skill for full CLI details.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.