From d68d4240e2e7daa8aea79a4263fa905aa3f2a7d1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 21 May 2026 00:57:12 +0100 Subject: [PATCH] Clarify Bifrost dispatch receipts --- docs/agent-transport.md | 2 +- tools/dispatch-agent-requests.mjs | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/agent-transport.md b/docs/agent-transport.md index 313dc89..d06a359 100644 --- a/docs/agent-transport.md +++ b/docs/agent-transport.md @@ -119,7 +119,7 @@ node .\tools\agent-transport.mjs apply-snapshot --in E:\tmp\bifrost-agent-transp `enqueue` also mirrors the queued request into `#bifrost` by default. Use `--mirror-content-file` when a Face has a better human-facing line than the fallback receipt; use `--mirror-dry-run true` only for smoke tests. -Dispatch receipts should use Bifrost's own public persona in the Bifrost governance channel. `tools/dispatch-agent-requests.mjs` reads `BIFROST_DISCORD_CHANNEL_ID` or `DISCORD_BIFROST_CHANNEL_ID` for the receipt target, uses persona name `Bifrost`, and defaults the persona avatar to the public `src/Bifrost.Web/wwwroot/img/bifrost-profile.png` raw GitHub URL unless `BIFROST_DISCORD_PERSONA_AVATAR_URL` or `DISCORD_PERSONA_AVATAR_URL_BIFROST` overrides it. +Dispatch receipts should use Bifrost's own public persona in the Bifrost governance channel. `tools/dispatch-agent-requests.mjs` reads `BIFROST_DISCORD_CHANNEL_ID` or `DISCORD_BIFROST_CHANNEL_ID` for the receipt target, uses persona name `Bifrost`, and defaults the persona avatar to the public `src/Bifrost.Web/wwwroot/img/bifrost-profile.png` raw GitHub URL unless `BIFROST_DISCORD_PERSONA_AVATAR_URL` or `DISCORD_PERSONA_AVATAR_URL_BIFROST` overrides it. Receipt text must lead with the concrete repo and work title, not a generic "recent consensus" summary, and must not expose request ids, workspace paths, log paths, or other debugging debris in Discord. The `snapshot` command writes a MessagePack-encoded `cultnet.snapshot_response_raw.v0` message. This keeps CultCache payload bytes intact for peers that share the document binding. diff --git a/tools/dispatch-agent-requests.mjs b/tools/dispatch-agent-requests.mjs index f40942d..5440af0 100644 --- a/tools/dispatch-agent-requests.mjs +++ b/tools/dispatch-agent-requests.mjs @@ -400,14 +400,7 @@ function postDispatchReceipt(request, dispatchRecord, options) { optionalString(process.env.BIFROST_DISCORD_PERSONA_AVATAR_URL) ?? optionalString(process.env.DISCORD_PERSONA_AVATAR_URL_BIFROST) ?? defaultPersonaAvatarUrl; - const topic = summarizeRequestTopic(request); - const content = [ - `Bifrost dispatch: ${request.targetAgentIdentity ?? "repo agent"} has this.`, - ``, - `**${request.targetRepoName}: ${topic}**`, - ``, - `A Codex turn is open in the ${request.targetRepoName} workspace. Keep sharpening the answer in here; the work is no longer waiting for a claimant.`, - ].join("\n"); + const content = renderDispatchReceiptContent(request); runNodeJson([ bridgeCli, @@ -428,6 +421,21 @@ function resolveDispatchReceiptChannelId(options) { ); } +function renderDispatchReceiptContent(request) { + const topic = summarizeRequestTopic(request); + const actor = request.targetAgentIdentity + ? `${request.targetAgentIdentity} / ${request.targetRepoName}` + : request.targetRepoName; + return [ + `Bifrost dispatch receipt`, + ``, + `**${request.targetRepoName}: ${topic}**`, + ``, + `Codex has started a turn for ${actor}. The claim is now specific enough to inspect, and the work is no longer sitting unclaimed in chat.`, + `Keep discussion here if it sharpens this request; Bifrost will carry the result back across the bridge.`, + ].join("\n"); +} + class CodexAppServerClient { constructor({ command, logPath }) { this.command = command;