Skip to main content

conversationScoped

@forge/monorepo


@forge/monorepo / backend/src / conversationScoped

Function: conversationScoped()

conversationScoped(run, capability): ConversationId

Defined in: backend/src/runtime/index.ts:98

The conversation a run belongs to, or a refusal — #198 AC-3.

The whole point of making conversationId optional is that a run without one no longer invents one. That creates a second hazard immediately: a caller reaching for conversation-scoped data — history, compaction, thread summaries — and receiving nothing rather than an error.

Silently empty is the worse failure. An automation whose history came back empty would look like a fresh conversation, the model would be prompted as if nothing had happened, and the run would produce a confident answer built on an absence nobody reported. That is the same class of defect as a scan reporting zero references for a directory it could not read.

So this throws, naming the capability the caller asked for. Reaching for history on a run that has no conversation is a programming error, and the message says which one.

Parameters

run

Run

capability

string

Returns

ConversationId