Golem fire and forget ts

From golemcloud/golem · View interactive version

Golem fire and forget ts is an AI agent skill from the GitHub repository golemcloud/golem. Triggering an agent invocation without waiting for the result in a TypeScript Golem project. Use when the user asks about fire-and-forget calls, async triggers, or enqueuing agent work.

How to use this skill

Skill file

Fire-and-Forget Agent Invocation (TypeScript)

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.

Usage

Every method on a definition RPC client has a .trigger() variant. It takes

the same input record as the awaited call but returns void immediately:

import { CounterAgent } from './counter-agent.js';

const counter = CounterAgent.client.upsert({ name: 'my-counter' });

// Fire-and-forget — returns immediately
counter.increment.trigger();          // input: {}

// With arguments
const processor = DataProcessor.client.upsert({ name: 'pipeline-1' });
processor.processBatch.trigger({ batch: batchData });

For an agent in another component, the generated guest client exposes the same

.trigger() method, but its constructor uses flattened id parameters:

import { CounterAgent } from 'counter-agent-guest-client';

CounterAgent.upsert('my-counter').increment.trigger();

See the golem-call-another-agent-ts skill for the required golem.yaml and

tsconfig.json setup. Use the definition's .client for same-component calls.

When to Use

Example: Breaking a Deadlock

import { AgentA } from './agent-a.js';
import { AgentB } from './agent-b.js';

// In AgentA — calls AgentB and waits
const b = AgentB.client.upsert({ name: 'b1' });
const result = await b.doWork({ data }); // OK: awaited call

// In AgentB — notifies AgentA without waiting (would deadlock if awaited)
const a = AgentA.client.upsert({ name: 'a1' });
a.onWorkDone.trigger({ result }); // OK: fire-and-forget

CLI Equivalent

From the command line, use --trigger (or -t) to enqueue an invocation without

waiting:

golem agent invoke --trigger 'CounterAgent("my-counter")' increment
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.