OpenParable
Skip to content
← Back to skills

Golem Fire And Forget Moonbit

Agent Building
golem-fire-and-forget-moonbit

Golem Fire And Forget Moonbit is an Agent Skill for agent building published in the golemcloud/golem repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/golemcloud/golem/blob/HEAD/golem-skills/skills/moonbit/golem-fire-and-forget-moonbit/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/golem-fire-and-forget-moonbit, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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

Every method on the auto-generated AgentClient has a corresponding trigger_ variant. Use AgentClient::scoped to obtain a client instance, then call the trigger_ method:

AgentClient::scoped("my-counter", fn(client) raise @common.AgentError {
  client.trigger_increment()
})

With arguments:

DataProcessorClient::scoped("pipeline-1", fn(client) raise @common.AgentError {
  client.trigger_process_batch(batch_data)
})

When to Use

  • Breaking RPC cycles: If agent A calls agent B and B needs to call back to A, use trigger_ for the callback to avoid deadlocks
  • Background work: Enqueue work on another agent without blocking the current agent
  • Fan-out: Trigger work on many agents in parallel without waiting for all results
  • Event-driven patterns: Notify other agents about events without coupling to their processing time

Example: Breaking a Deadlock

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

// In AgentB — notifies AgentA without waiting (would deadlock if awaited)
AgentAClient::scoped("a1", fn(client) raise @common.AgentError {
  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(region, fn(client) raise @common.AgentError {
    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.